Version 22.78.5: Mar 22, 2023 Code refactoring in banners.

This commit is contained in:
acanas 2023-03-23 09:35:20 +01:00
parent 3c0524d640
commit fc87db628c
160 changed files with 1001 additions and 996 deletions

View File

@ -298,11 +298,11 @@ static bool API_WriteRowFileBrowser (FILE *XML,unsigned Level,
const char *FileName); const char *FileName);
static void API_IndentXMLLine (FILE *XML,unsigned Level); static void API_IndentXMLLine (FILE *XML,unsigned Level);
static void API_GetDataOfLocation (struct soap *soap, static void API_GetLocationData (struct soap *soap,
struct swad__location *location, struct swad__location *location,
time_t *CheckInTime, time_t *CheckInTime,
MYSQL_RES **mysql_res, MYSQL_RES **mysql_res,
unsigned NumLocs); unsigned NumLocs);
static void API_ResetLocation (struct soap *soap, static void API_ResetLocation (struct soap *soap,
struct swad__location *location); struct swad__location *location);
@ -914,7 +914,7 @@ int swad__loginBySessionKey (struct soap *soap,
/***** Get course (row[2]) *****/ /***** Get course (row[2]) *****/
Gbl.Hierarchy.Crs.CrsCod = Str_ConvertStrCodToLongCod (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; loginBySessionKeyOut->courseCode = (int) Gbl.Hierarchy.Crs.CrsCod;
Str_Copy (loginBySessionKeyOut->courseName,Gbl.Hierarchy.Crs.FullName, Str_Copy (loginBySessionKeyOut->courseName,Gbl.Hierarchy.Crs.FullName,
Cns_HIERARCHY_MAX_BYTES_FULL_NAME); Cns_HIERARCHY_MAX_BYTES_FULL_NAME);
@ -925,7 +925,7 @@ int swad__loginBySessionKey (struct soap *soap,
/***** Get degree (row[1]) *****/ /***** Get degree (row[1]) *****/
Gbl.Hierarchy.Deg.DegCod = Str_ConvertStrCodToLongCod (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; loginBySessionKeyOut->degreeCode = (int) Gbl.Hierarchy.Deg.DegCod;
Str_Copy (loginBySessionKeyOut->degreeName,Gbl.Hierarchy.Deg.FullName, Str_Copy (loginBySessionKeyOut->degreeName,Gbl.Hierarchy.Deg.FullName,
Cns_HIERARCHY_MAX_BYTES_FULL_NAME); Cns_HIERARCHY_MAX_BYTES_FULL_NAME);
@ -2286,7 +2286,7 @@ int swad__getAttendanceEvents (struct soap *soap,
"Requester must be a teacher"); "Requester must be a teacher");
/***** Query list of attendance events *****/ /***** Query list of attendance events *****/
NumAttEvents = Att_DB_GetDataOfAllAttEvents (&mysql_res,courseCode); NumAttEvents = Att_DB_GetAllEventsData (&mysql_res,courseCode);
getAttendanceEventsOut->eventsArray.__size = getAttendanceEventsOut->eventsArray.__size =
getAttendanceEventsOut->numEvents = (int) NumAttEvents; getAttendanceEventsOut->numEvents = (int) NumAttEvents;
@ -2307,7 +2307,7 @@ int swad__getAttendanceEvents (struct soap *soap,
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
/* Get attendance event (except Txt) */ /* 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].attendanceEventCode = (int) Event.AttCod;
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].hidden = Event.Hidden ? 1 : getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].hidden = Event.Hidden ? 1 :
@ -2472,7 +2472,7 @@ int swad__sendAttendanceEvent (struct soap *soap,
/* Course code */ /* Course code */
if (Event.AttCod > 0) // The event already exists if (Event.AttCod > 0) // The event already exists
{ {
Att_GetDataOfAttEventByCod (&Event); Att_GetEventDataByCod (&Event);
if (Event.CrsCod != (long) courseCode) if (Event.CrsCod != (long) courseCode)
return soap_receiver_fault (soap, return soap_receiver_fault (soap,
"Request forbidden", "Request forbidden",
@ -2512,9 +2512,9 @@ int swad__sendAttendanceEvent (struct soap *soap,
/***** Create or update attendance event *****/ /***** Create or update attendance event *****/
if (ItsANewAttEvent) if (ItsANewAttEvent)
Att_CreateAttEvent (&Event,text); // Add new attendance event to database Att_CreateEvent (&Event,text); // Add new attendance event to database
else else
Att_UpdateAttEvent (&Event,text); // Modify existing attendance event Att_UpdateEvent (&Event,text); // Modify existing attendance event
/***** Free memory for list of selected groups *****/ /***** Free memory for list of selected groups *****/
Grp_FreeListCodSelectedGrps (); Grp_FreeListCodSelectedGrps ();
@ -2555,7 +2555,7 @@ int swad__removeAttendanceEvent (struct soap *soap,
/* Course code */ /* Course code */
if (Event.AttCod > 0) // The event already exists if (Event.AttCod > 0) // The event already exists
{ {
Att_GetDataOfAttEventByCod (&Event); Att_GetEventDataByCod (&Event);
Gbl.Hierarchy.Crs.CrsCod = Event.CrsCod; Gbl.Hierarchy.Crs.CrsCod = Event.CrsCod;
} }
else else
@ -2584,7 +2584,7 @@ int swad__removeAttendanceEvent (struct soap *soap,
"Requester must be a teacher"); "Requester must be a teacher");
/***** Remove the attendance event from database *****/ /***** Remove the attendance event from database *****/
Att_RemoveAttEventFromDB (Event.AttCod); Att_RemoveEventFromDB (Event.AttCod);
removeAttendanceEventOut->attendanceEventCode = Event.AttCod; removeAttendanceEventOut->attendanceEventCode = Event.AttCod;
@ -2663,7 +2663,7 @@ int swad__getAttendanceUsers (struct soap *soap,
/***** Get course of this attendance event *****/ /***** Get course of this attendance event *****/
Event.AttCod = (long) attendanceEventCode; Event.AttCod = (long) attendanceEventCode;
Att_GetDataOfAttEventByCod (&Event); Att_GetEventDataByCod (&Event);
Gbl.Hierarchy.Crs.CrsCod = Event.CrsCod; Gbl.Hierarchy.Crs.CrsCod = Event.CrsCod;
/***** Get some of my data *****/ /***** Get some of my data *****/
@ -2685,7 +2685,7 @@ int swad__getAttendanceUsers (struct soap *soap,
"AttCod", "AttCod",
Event.AttCod); Event.AttCod);
NumUsrs = Att_DB_GetListUsrsInAttEvent (&mysql_res,Event.AttCod,AttEventIsAsociatedToGrps); NumUsrs = Att_DB_GetListUsrsInEvent (&mysql_res,Event.AttCod,AttEventIsAsociatedToGrps);
getAttendanceUsersOut->numUsers = getAttendanceUsersOut->numUsers =
getAttendanceUsersOut->usersArray.__size = (int) NumUsrs; getAttendanceUsersOut->usersArray.__size = (int) NumUsrs;
@ -2810,7 +2810,7 @@ int swad__sendAttendanceUsers (struct soap *soap,
/***** Get course of this attendance event *****/ /***** Get course of this attendance event *****/
Event.AttCod = (long) attendanceEventCode; Event.AttCod = (long) attendanceEventCode;
if (!Att_GetDataOfAttEventByCod (&Event)) if (!Att_GetEventDataByCod (&Event))
return SOAP_OK; // return with success = 0 return SOAP_OK; // return with success = 0
Gbl.Hierarchy.Crs.CrsCod = Event.CrsCod; Gbl.Hierarchy.Crs.CrsCod = Event.CrsCod;
@ -2833,7 +2833,7 @@ int swad__sendAttendanceUsers (struct soap *soap,
/***** Purge absent users without comments from table *****/ /***** Purge absent users without comments from table *****/
if (setOthersAsAbsent) if (setOthersAsAbsent)
Att_DB_RemoveUsrsAbsentWithoutCommentsFromAttEvent (Event.AttCod); Att_DB_RemoveUsrsAbsentWithoutCommentsFromEvent (Event.AttCod);
sendAttendanceUsersOut->success = 1; sendAttendanceUsersOut->success = 1;
@ -2931,7 +2931,7 @@ int swad__getNotifications (struct soap *soap,
/* Get course (row[7]) */ /* Get course (row[7]) */
Hie.Crs.CrsCod = Str_ConvertStrCodToLongCod (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]) */ /* Get user's code of the user who caused the event (row[3]) */
Gbl.Usrs.Other.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (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]) */ /* Get institution (row[4]) */
Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[4]); Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[4]);
Ins_GetDataOfInstitByCod (&Hie.Ins); Ins_GetInstitDataByCod (&Hie.Ins);
/* Get center (row[5]) */ /* Get center (row[5]) */
Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[5]); Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[5]);
Ctr_GetDataOfCenterByCod (&Hie.Ctr); Ctr_GetCenterDataByCod (&Hie.Ctr);
/* Get degree (row[6]) */ /* Get degree (row[6]) */
Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[6]); Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[6]);
Deg_GetDataOfDegreeByCod (&Hie.Deg); Deg_GetDegreeDataByCod (&Hie.Deg);
/* Get message/post/... code (row[8]) */ /* Get message/post/... code (row[8]) */
Cod = Str_ConvertStrCodToLongCod (row[8]); Cod = Str_ConvertStrCodToLongCod (row[8]);
@ -3952,7 +3952,7 @@ int swad__getTrivialQuestion (struct soap *soap,
if (QstCod > 0) if (QstCod > 0)
{ {
/***** Get answer from database *****/ /***** Get answer from database *****/
NumAnss = Qst_DB_GetDataOfAnswers (&mysql_res,QstCod, NumAnss = Qst_DB_GetAnswersData (&mysql_res,QstCod,
false); // Don't shuffle false); // Don't shuffle
getTrivialQuestionOut->answersArray.__size = (int) NumAnss; getTrivialQuestionOut->answersArray.__size = (int) NumAnss;
@ -4209,7 +4209,7 @@ int swad__getMatches (struct soap *soap,
return soap_sender_fault (soap, return soap_sender_fault (soap,
"Bad game code", "Bad game code",
"Game code must be a integer greater than 0"); "Game code must be a integer greater than 0");
Gam_GetDataOfGameByCod (&Game); Gam_GetGameDataByCod (&Game);
/***** Get some of my data *****/ /***** Get some of my data *****/
if (!API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Me.UsrDat,Gbl.Hierarchy.Crs.CrsCod)) 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, return soap_sender_fault (soap,
"Bad game code", "Bad game code",
"Game code must be a integer greater than 0"); "Game code must be a integer greater than 0");
Gam_GetDataOfGameByCod (&Game); Gam_GetGameDataByCod (&Game);
/***** Get match data from database *****/ /***** Get match data from database *****/
if (Match.MchCod <= 0) if (Match.MchCod <= 0)
return soap_sender_fault (soap, return soap_sender_fault (soap,
"Bad match code", "Bad match code",
"Match code must be a integer greater than 0"); "Match code must be a integer greater than 0");
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/* Check that match belongs to game */ /* Check that match belongs to game */
if (Match.GamCod != Game.GamCod) if (Match.GamCod != Game.GamCod)
@ -4492,14 +4492,14 @@ int swad__answerMatchQuestion (struct soap *soap,
return soap_sender_fault (soap, return soap_sender_fault (soap,
"Bad game code", "Bad game code",
"Game code must be a integer greater than 0"); "Game code must be a integer greater than 0");
Gam_GetDataOfGameByCod (&Game); Gam_GetGameDataByCod (&Game);
/***** Get match data from database *****/ /***** Get match data from database *****/
if (Match.MchCod <= 0) if (Match.MchCod <= 0)
return soap_sender_fault (soap, return soap_sender_fault (soap,
"Bad match code", "Bad match code",
"Match code must be a integer greater than 0"); "Match code must be a integer greater than 0");
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Check that match belongs to game *****/ /***** Check that match belongs to game *****/
if (Match.GamCod != Game.GamCod) if (Match.GamCod != Game.GamCod)
@ -5184,7 +5184,7 @@ int swad__getLocation (struct soap *soap,
/***** Get location *****/ /***** Get location *****/
NumLocs = Roo_DB_GetLocationByMAC (&mysql_res,MACnum); NumLocs = Roo_DB_GetLocationByMAC (&mysql_res,MACnum);
API_GetDataOfLocation (soap, API_GetLocationData (soap,
&(getLocationOut->location), &(getLocationOut->location),
NULL, // Don't get check in time NULL, // Don't get check in time
&mysql_res,NumLocs); &mysql_res,NumLocs);
@ -5271,7 +5271,7 @@ int swad__getLastLocation (struct soap *soap,
{ {
/***** Get list of locations *****/ /***** Get list of locations *****/
NumLocs = Roo_DB_GetUsrLastLocation (&mysql_res,(long) userCode); NumLocs = Roo_DB_GetUsrLastLocation (&mysql_res,(long) userCode);
API_GetDataOfLocation (soap, API_GetLocationData (soap,
&(getLastLocationOut->location), &(getLastLocationOut->location),
&(getLastLocationOut->checkinTime), // Get check in time &(getLastLocationOut->checkinTime), // Get check in time
&mysql_res,NumLocs); &mysql_res,NumLocs);
@ -5290,11 +5290,11 @@ int swad__getLastLocation (struct soap *soap,
/************************* Get assignment data *******************************/ /************************* Get assignment data *******************************/
/*****************************************************************************/ /*****************************************************************************/
static void API_GetDataOfLocation (struct soap *soap, static void API_GetLocationData (struct soap *soap,
struct swad__location *location, struct swad__location *location,
time_t *CheckInTime, time_t *CheckInTime,
MYSQL_RES **mysql_res, MYSQL_RES **mysql_res,
unsigned NumLocs) unsigned NumLocs)
{ {
MYSQL_ROW row; MYSQL_ROW row;
size_t Length; size_t Length;

View File

@ -977,7 +977,7 @@ void Acc_CompletelyEliminateAccount (struct Usr_Data *UsrDat,
Prj_RemoveUsrFromProjects (UsrDat->UsrCod); Prj_RemoveUsrFromProjects (UsrDat->UsrCod);
/***** Remove user from all attendance events *****/ /***** Remove user from all attendance events *****/
Att_DB_RemoveUsrFromAllAttEvents (UsrDat->UsrCod); Att_DB_RemoveUsrFromAllEvents (UsrDat->UsrCod);
/***** Remove user from all groups of all courses *****/ /***** Remove user from all groups of all courses *****/
Grp_RemUsrFromAllGrps (UsrDat->UsrCod); Grp_RemUsrFromAllGrps (UsrDat->UsrCod);

View File

@ -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" }, [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" }, [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" }, [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" }, [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" }, [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" }, [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}, [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}, [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}, [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}, [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_ReqCreatOrEditAttEvent ,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_ReceiveFormAttEvent ,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_ReceiveFormAttEvent ,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_AskRemAttEvent ,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_GetAndRemAttEvent ,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_HideAttEvent ,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_UnhideAttEvent ,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_SeeOneAttEvent ,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}, [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}, [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_RegisterMeAsStdInAttEvent ,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}, [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}, [ActUpdSignUpReq ] = {1522,-1,TabUnk,ActSeeSignUpReq ,0x3E0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Enr_UpdateEnrolmentRequests ,NULL},

View File

@ -115,7 +115,7 @@ static void Agd_GetPars (struct Agd_Agenda *Agenda,
static void Agd_GetListEvents (struct Agd_Agenda *Agenda, static void Agd_GetListEvents (struct Agd_Agenda *Agenda,
Agd_AgendaType_t AgendaType); 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); 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; AgdEvent.UsrCod = Gbl.Usrs.Other.UsrDat.UsrCod;
break; break;
} }
Agd_GetDataOfEventByCod (&AgdEvent); Agd_GetventDataByCod (&AgdEvent);
/***** Set anchor string *****/ /***** Set anchor string *****/
Frm_SetAnchorStr (AgdEvent.AgdCod,&Anchor); Frm_SetAnchorStr (AgdEvent.AgdCod,&Anchor);
@ -1079,13 +1079,13 @@ static void Agd_GetListEvents (struct Agd_Agenda *Agenda,
/*********************** Get event data using its code ***********************/ /*********************** 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_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
/***** Get data of event from database *****/ /***** 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: /* Get row:
row[0] AgdCod row[0] AgdCod
@ -1176,7 +1176,7 @@ void Agd_AskRemEvent (void)
/***** Get data of the event from database *****/ /***** Get data of the event from database *****/
AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
Agd_GetDataOfEventByCod (&AgdEvent); Agd_GetventDataByCod (&AgdEvent);
/***** Show question and button to remove event *****/ /***** Show question and button to remove event *****/
Agenda.AgdCodToEdit = AgdEvent.AgdCod; Agenda.AgdCodToEdit = AgdEvent.AgdCod;
@ -1211,7 +1211,7 @@ void Agd_RemoveEvent (void)
/***** Get data of the event from database *****/ /***** Get data of the event from database *****/
AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
Agd_GetDataOfEventByCod (&AgdEvent); Agd_GetventDataByCod (&AgdEvent);
/***** Remove event *****/ /***** Remove event *****/
Agd_DB_RemoveEvent (&AgdEvent); Agd_DB_RemoveEvent (&AgdEvent);
@ -1244,7 +1244,7 @@ void Agd_HideEvent (void)
/***** Get data of the event from database *****/ /***** Get data of the event from database *****/
AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
Agd_GetDataOfEventByCod (&AgdEvent); Agd_GetventDataByCod (&AgdEvent);
/***** Hide event *****/ /***** Hide event *****/
Agd_DB_HideOrUnhideEvent (AgdEvent.AgdCod,AgdEvent.UsrCod,true); Agd_DB_HideOrUnhideEvent (AgdEvent.AgdCod,AgdEvent.UsrCod,true);
@ -1273,7 +1273,7 @@ void Agd_UnhideEvent (void)
/***** Get data of the event from database *****/ /***** Get data of the event from database *****/
AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
Agd_GetDataOfEventByCod (&AgdEvent); Agd_GetventDataByCod (&AgdEvent);
/***** Unhide event *****/ /***** Unhide event *****/
Agd_DB_HideOrUnhideEvent (AgdEvent.AgdCod,AgdEvent.UsrCod,false); Agd_DB_HideOrUnhideEvent (AgdEvent.AgdCod,AgdEvent.UsrCod,false);
@ -1303,7 +1303,7 @@ void Agd_MakeEventPrivate (void)
/***** Get data of the event from database *****/ /***** Get data of the event from database *****/
AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
Agd_GetDataOfEventByCod (&AgdEvent); Agd_GetventDataByCod (&AgdEvent);
/***** Make event private *****/ /***** Make event private *****/
Agd_DB_MakeEventPrivate (&AgdEvent); Agd_DB_MakeEventPrivate (&AgdEvent);
@ -1337,7 +1337,7 @@ void Agd_MakeEventPublic (void)
/***** Get data of the event from database *****/ /***** Get data of the event from database *****/
AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
Agd_GetDataOfEventByCod (&AgdEvent); Agd_GetventDataByCod (&AgdEvent);
/***** Make event public *****/ /***** Make event public *****/
Agd_DB_MakeEventPublic (&AgdEvent); Agd_DB_MakeEventPublic (&AgdEvent);
@ -1399,7 +1399,7 @@ void Agd_ReqCreatOrEditEvent (void)
else else
{ {
/* Get data of the event from database */ /* Get data of the event from database */
Agd_GetDataOfEventByCod (&AgdEvent); Agd_GetventDataByCod (&AgdEvent);
/* Get text of the event from database */ /* Get text of the event from database */
Agd_DB_GetEventTxt (&AgdEvent,Txt); Agd_DB_GetEventTxt (&AgdEvent,Txt);

View File

@ -172,8 +172,8 @@ unsigned Agd_DB_GetListEvents (MYSQL_RES **mysql_res,
/*********************** Get event data using its code ***********************/ /*********************** Get event data using its code ***********************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Agd_DB_GetDataOfEventByCod (MYSQL_RES **mysql_res, unsigned Agd_DB_GetEventDataByCod (MYSQL_RES **mysql_res,
const struct Agd_Event *AgdEvent) const struct Agd_Event *AgdEvent)
{ {
/***** Get data of event from database *****/ /***** Get data of event from database *****/
return (unsigned) return (unsigned)

View File

@ -39,8 +39,8 @@ unsigned Agd_DB_GetListEvents (MYSQL_RES **mysql_res,
const struct Agd_Agenda *Agenda, const struct Agd_Agenda *Agenda,
Agd_AgendaType_t AgendaType); Agd_AgendaType_t AgendaType);
unsigned Agd_DB_GetDataOfEventByCod (MYSQL_RES **mysql_res, unsigned Agd_DB_GetEventDataByCod (MYSQL_RES **mysql_res,
const struct Agd_Event *AgdEvent); const struct Agd_Event *AgdEvent);
void Agd_DB_GetEventTxt (const struct Agd_Event *AgdEvent, void Agd_DB_GetEventTxt (const struct Agd_Event *AgdEvent,
char Txt[Cns_MAX_BYTES_TEXT + 1]); char Txt[Cns_MAX_BYTES_TEXT + 1]);

View File

@ -493,7 +493,7 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
char Txt[Cns_MAX_BYTES_TEXT + 1]; char Txt[Cns_MAX_BYTES_TEXT + 1];
/***** Get data of this assignment *****/ /***** Get data of this assignment *****/
Asg_GetDataOfAssignmentByCod (&Assignments->Asg); Asg_GetAssignmentDataByCod (&Assignments->Asg);
/***** Set anchor string *****/ /***** Set anchor string *****/
Frm_SetAnchorStr (Assignments->Asg.AsgCod,&Anchor); Frm_SetAnchorStr (Assignments->Asg.AsgCod,&Anchor);
@ -824,7 +824,7 @@ static void Asg_GetListAssignments (struct Asg_Assignments *Assignments)
/******************* Get assignment data using its code **********************/ /******************* Get assignment data using its code **********************/
/*****************************************************************************/ /*****************************************************************************/
void Asg_GetDataOfAssignmentByCod (struct Asg_Assignment *Asg) void Asg_GetAssignmentDataByCod (struct Asg_Assignment *Asg)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
unsigned NumAsgs; unsigned NumAsgs;
@ -832,7 +832,7 @@ void Asg_GetDataOfAssignmentByCod (struct Asg_Assignment *Asg)
if (Asg->AsgCod > 0) if (Asg->AsgCod > 0)
{ {
/***** Build query *****/ /***** Build query *****/
NumAsgs = Asg_DB_GetDataOfAssignmentByCod (&mysql_res,Asg->AsgCod); NumAsgs = Asg_DB_GetAssignmentDataByCod (&mysql_res,Asg->AsgCod);
/***** Get data of assignment *****/ /***** Get data of assignment *****/
Asg_GetAssignmentDataFromRow (&mysql_res,Asg,NumAsgs); Asg_GetAssignmentDataFromRow (&mysql_res,Asg,NumAsgs);
@ -849,7 +849,7 @@ void Asg_GetDataOfAssignmentByCod (struct Asg_Assignment *Asg)
/*************** Get assignment data using its folder name *******************/ /*************** 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; MYSQL_RES *mysql_res;
unsigned NumAsgs; unsigned NumAsgs;
@ -857,7 +857,7 @@ void Asg_GetDataOfAssignmentByFolder (struct Asg_Assignment *Asg)
if (Asg->Folder[0]) if (Asg->Folder[0])
{ {
/***** Query database *****/ /***** Query database *****/
NumAsgs = Asg_DB_GetDataOfAssignmentByFolder (&mysql_res,Asg->Folder); NumAsgs = Asg_DB_GetAssignmentDataByFolder (&mysql_res,Asg->Folder);
/***** Get data of assignment *****/ /***** Get data of assignment *****/
Asg_GetAssignmentDataFromRow (&mysql_res,Asg,NumAsgs); Asg_GetAssignmentDataFromRow (&mysql_res,Asg,NumAsgs);
@ -1025,7 +1025,7 @@ void Asg_ReqRemAssignment (void)
Assignments.Asg.AsgCod = ParCod_GetAndCheckPar (ParCod_Asg); Assignments.Asg.AsgCod = ParCod_GetAndCheckPar (ParCod_Asg);
/***** Get data of the assignment from database *****/ /***** Get data of the assignment from database *****/
Asg_GetDataOfAssignmentByCod (&Assignments.Asg); Asg_GetAssignmentDataByCod (&Assignments.Asg);
/***** Show question and button to remove the assignment *****/ /***** Show question and button to remove the assignment *****/
Ale_ShowAlertAndButton (ActRemAsg,NULL,NULL, Ale_ShowAlertAndButton (ActRemAsg,NULL,NULL,
@ -1059,7 +1059,7 @@ void Asg_RemoveAssignment (void)
Assignments.Asg.AsgCod = ParCod_GetAndCheckPar (ParCod_Asg); Assignments.Asg.AsgCod = ParCod_GetAndCheckPar (ParCod_Asg);
/***** Get data of the assignment from database *****/ /***** 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 *****/ /***** Remove all folders associated to this assignment *****/
if (Assignments.Asg.Folder[0]) if (Assignments.Asg.Folder[0])
@ -1102,7 +1102,7 @@ void Asg_HideAssignment (void)
Assignments.Asg.AsgCod = ParCod_GetAndCheckPar (ParCod_Asg); Assignments.Asg.AsgCod = ParCod_GetAndCheckPar (ParCod_Asg);
/***** Get data of the assignment from database *****/ /***** Get data of the assignment from database *****/
Asg_GetDataOfAssignmentByCod (&Assignments.Asg); Asg_GetAssignmentDataByCod (&Assignments.Asg);
/***** Hide assignment *****/ /***** Hide assignment *****/
Asg_DB_HideOrUnhideAssignment (Assignments.Asg.AsgCod,true); Asg_DB_HideOrUnhideAssignment (Assignments.Asg.AsgCod,true);
@ -1131,7 +1131,7 @@ void Asg_UnhideAssignment (void)
Assignments.Asg.AsgCod = ParCod_GetAndCheckPar (ParCod_Asg); Assignments.Asg.AsgCod = ParCod_GetAndCheckPar (ParCod_Asg);
/***** Get data of the assignment from database *****/ /***** Get data of the assignment from database *****/
Asg_GetDataOfAssignmentByCod (&Assignments.Asg); Asg_GetAssignmentDataByCod (&Assignments.Asg);
/***** Unhide assignment *****/ /***** Unhide assignment *****/
Asg_DB_HideOrUnhideAssignment (Assignments.Asg.AsgCod,false); Asg_DB_HideOrUnhideAssignment (Assignments.Asg.AsgCod,false);
@ -1197,7 +1197,7 @@ void Asg_ReqCreatOrEditAsg (void)
else else
{ {
/* Get data of the assignment from database */ /* Get data of the assignment from database */
Asg_GetDataOfAssignmentByCod (&Assignments.Asg); Asg_GetAssignmentDataByCod (&Assignments.Asg);
/* Get text of the assignment from database */ /* Get text of the assignment from database */
Asg_DB_GetAssignmentTxtByCod (Assignments.Asg.AsgCod,Txt); Asg_DB_GetAssignmentTxtByCod (Assignments.Asg.AsgCod,Txt);
@ -1411,7 +1411,7 @@ void Asg_ReceiveFormAssignment (void)
{ {
/***** Get data of the old (current) assignment from database *****/ /***** Get data of the old (current) assignment from database *****/
OldAsg.AsgCod = Assignments.Asg.AsgCod; OldAsg.AsgCod = Assignments.Asg.AsgCod;
Asg_GetDataOfAssignmentByCod (&OldAsg); Asg_GetAssignmentDataByCod (&OldAsg);
} }
/***** Get start/end date-times *****/ /***** Get start/end date-times *****/

View File

@ -91,8 +91,8 @@ void Asg_ShowOneAssignmentInBox (struct Asg_Assignments *Assignments);
Dat_StartEndTime_t Asg_GetParAsgOrder (void); Dat_StartEndTime_t Asg_GetParAsgOrder (void);
void Asg_ReqCreatOrEditAsg (void); void Asg_ReqCreatOrEditAsg (void);
void Asg_GetDataOfAssignmentByCod (struct Asg_Assignment *Asg); void Asg_GetAssignmentDataByCod (struct Asg_Assignment *Asg);
void Asg_GetDataOfAssignmentByFolder (struct Asg_Assignment *Asg); void Asg_GetAssignmentDataByFolder (struct Asg_Assignment *Asg);
void Asg_GetNotifAssignment (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], void Asg_GetNotifAssignment (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr, char **ContentStr,

View File

@ -136,7 +136,7 @@ unsigned Asg_DB_GetListAssignmentsAllGrps (MYSQL_RES **mysql_res,
/******************* Get assignment data using its code **********************/ /******************* 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get assignment data", 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 ******************/ /**************** Get assignment data using its folder name ******************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Asg_DB_GetDataOfAssignmentByFolder (MYSQL_RES **mysql_res, unsigned Asg_DB_GetAssignmentDataByFolder (MYSQL_RES **mysql_res,
const char Folder[Brw_MAX_BYTES_FOLDER + 1]) const char Folder[Brw_MAX_BYTES_FOLDER + 1])
{ {
return (unsigned) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get assignment data", DB_QuerySELECT (mysql_res,"can not get assignment data",

View File

@ -42,9 +42,9 @@ unsigned Asg_DB_GetListAssignmentsMyGrps (MYSQL_RES **mysql_res,
unsigned Asg_DB_GetListAssignmentsAllGrps (MYSQL_RES **mysql_res, unsigned Asg_DB_GetListAssignmentsAllGrps (MYSQL_RES **mysql_res,
Dat_StartEndTime_t SelectedOrder); Dat_StartEndTime_t SelectedOrder);
unsigned Asg_DB_GetDataOfAssignmentByCod (MYSQL_RES **mysql_res,long AsgCod); unsigned Asg_DB_GetAssignmentDataByCod (MYSQL_RES **mysql_res,long AsgCod);
unsigned Asg_DB_GetDataOfAssignmentByFolder (MYSQL_RES **mysql_res, unsigned Asg_DB_GetAssignmentDataByFolder (MYSQL_RES **mysql_res,
const char Folder[Brw_MAX_BYTES_FOLDER + 1]); const char Folder[Brw_MAX_BYTES_FOLDER + 1]);
unsigned Asg_DB_GetAssignmentTitleAndTxtByCod (MYSQL_RES **mysql_res,long AsgCod); 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_GetAssignmentTitleByCod (long AsgCod,char Title[Asg_MAX_BYTES_ASSIGNMENT_TITLE + 1]);
void Asg_DB_GetAssignmentTxtByCod (long AsgCod,char Txt[Cns_MAX_BYTES_TEXT + 1]); void Asg_DB_GetAssignmentTxtByCod (long AsgCod,char Txt[Cns_MAX_BYTES_TEXT + 1]);

View File

@ -85,52 +85,52 @@ typedef enum
static void Att_ResetEvents (struct Att_Events *Events); 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_ParsWhichGroupsToShow (void *Events);
static void Att_PutIconsInListOfAttEvents (void *Events); static void Att_PutIconsInListOfEvents (void *Events);
static void Att_PutIconToCreateNewAttEvent (struct Att_Events *Events); static void Att_PutIconToCreateNewEvent (struct Att_Events *Events);
static void Att_PutButtonToCreateNewAttEvent (struct Att_Events *Events); static void Att_PutButtonToCreateNewEvent (struct Att_Events *Events);
static void Att_PutParsToCreateNewAttEvent (void *Events); static void Att_PutParsToCreateNewEvent (void *Events);
static void Att_PutParsToListUsrsAttendance (void *Events); static void Att_PutParsToListUsrsAttendance (void *Events);
static void Att_ShowOneAttEventRow (struct Att_Events *Events, static void Att_ShowOneEventRow (struct Att_Events *Events,
bool ShowOnlyThisAttEventComplete); bool ShowOnlyThisAttEventComplete);
static void Att_WriteAttEventAuthor (struct Att_Event *Event); static void Att_WriteEventAuthor (struct Att_Event *Event);
static Dat_StartEndTime_t Att_GetParAttOrder (void); static Dat_StartEndTime_t Att_GetParAttOrder (void);
static void Att_PutFormsToRemEditOneAttEvent (struct Att_Events *Events, static void Att_PutFormsToRemEditOneEvent (struct Att_Events *Events,
const char *Anchor); const char *Anchor);
static void Att_PutPars (void *Events); static void Att_PutPars (void *Events);
static void Att_GetListAttEvents (struct Att_Events *Events, static void Att_GetListEvents (struct Att_Events *Events,
Att_OrderNewestOldest_t OrderNewestOldest); Att_OrderNewestOldest_t OrderNewestOldest);
static void Att_GetDataOfAttEventByCodAndCheckCrs (struct Att_Event *Event); static void Att_GetEventDataByCodAndCheckCrs (struct Att_Event *Event);
static void Att_ResetAttendanceEvent (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_PutParAttCod (void *Events);
static void Att_ShowLstGrpsToEditAttEvent (long AttCod); static void Att_ShowLstGrpsToEditEvent (long AttCod);
static void Att_CreateGroups (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_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_ListEventOnlyMeAsStudent (struct Att_Event *Event);
static void Att_ListAttStudents (struct Att_Events *Events); static void Att_ListEventStudents (struct Att_Events *Events);
static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr, static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr,
struct Usr_Data *UsrDat, struct Usr_Data *UsrDat,
struct Att_Event *Event); struct Att_Event *Event);
static void Att_PutLinkAttEvent (struct Att_Event *Event, static void Att_PutLinkEvent (struct Att_Event *Event,
const char *Title,const char *Txt); const char *Title,const char *Txt);
static unsigned Att_GetNumUsrsFromAListWhoAreInAttEvent (long AttCod, static unsigned Att_GetNumUsrsFromAListWhoAreInEvent (long AttCod,
long LstSelectedUsrCods[], long LstSelectedUsrCods[],
unsigned NumUsrsInList); unsigned NumUsrsInList);
static bool Att_CheckIfUsrIsPresentInAttEvent (long AttCod,long UsrCod); static bool Att_CheckIfUsrIsPresentInEvent (long AttCod,long UsrCod);
static bool Att_CheckIfUsrIsPresentInAttEventAndGetComments (long AttCod,long UsrCod, static bool Att_CheckIfUsrIsPresentInEventAndGetComments (long AttCod,long UsrCod,
char CommentStd[Cns_MAX_BYTES_TEXT + 1], char CommentStd[Cns_MAX_BYTES_TEXT + 1],
char CommentTch[Cns_MAX_BYTES_TEXT + 1]); char CommentTch[Cns_MAX_BYTES_TEXT + 1]);
static void Att_ReqListOrPrintUsrsAttendanceCrs (void *TypeOfView); static void Att_ReqListOrPrintUsrsAttendanceCrs (void *TypeOfView);
static void Att_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t 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 *************************/ /************************ List all attendance events *************************/
/*****************************************************************************/ /*****************************************************************************/
void Att_SeeAttEvents (void) void Att_SeeEvents (void)
{ {
struct Att_Events Events; struct Att_Events Events;
@ -196,17 +196,17 @@ void Att_SeeAttEvents (void)
Events.CurrentPage = Pag_GetParPagNum (Pag_ATT_EVENTS); Events.CurrentPage = Pag_GetParPagNum (Pag_ATT_EVENTS);
/***** Get list of attendance events *****/ /***** Get list of attendance events *****/
Att_GetListAttEvents (&Events,Att_NEWEST_FIRST); Att_GetListEvents (&Events,Att_NEWEST_FIRST);
/***** Show all attendance events *****/ /***** Show all attendance events *****/
Att_ShowAllAttEvents (&Events); Att_ShowAllEvents (&Events);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************* Show all attendance 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 *Hlp_USERS_Attendance;
extern const char *Txt_Events; extern const char *Txt_Events;
@ -230,7 +230,7 @@ static void Att_ShowAllAttEvents (struct Att_Events *Events)
/***** Begin box *****/ /***** Begin box *****/
Box_BoxBegin ("100%",Txt_Events, Box_BoxBegin ("100%",Txt_Events,
Att_PutIconsInListOfAttEvents,Events, Att_PutIconsInListOfEvents,Events,
Hlp_USERS_Attendance,Box_NOT_CLOSABLE); Hlp_USERS_Attendance,Box_NOT_CLOSABLE);
/***** Select whether show only my groups or all groups *****/ /***** 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 *****/ /***** Get data of this attendance event *****/
Events->Event.AttCod = Events->Lst[NumAttEvent - 1].AttCod; Events->Event.AttCod = Events->Lst[NumAttEvent - 1].AttCod;
Att_GetDataOfAttEventByCodAndCheckCrs (&Events->Event); Att_GetEventDataByCodAndCheckCrs (&Events->Event);
Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInAttEvent (Events->Event.AttCod); Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInEvent (Events->Event.AttCod);
/***** Show one attendance event *****/ /***** Show one attendance event *****/
Att_ShowOneAttEventRow (Events, Att_ShowOneEventRow (Events,
false); // Don't show only this event 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 *****/ /***** Button to create a new attendance event *****/
if (ICanEdit) if (ICanEdit)
Att_PutButtonToCreateNewAttEvent (Events); Att_PutButtonToCreateNewEvent (Events);
/***** End box *****/ /***** End box *****/
Box_BoxEnd (); Box_BoxEnd ();
/***** Free list of attendance events *****/ /***** 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 *************/ /************* Put contextual icons in list of attendance events *************/
/*****************************************************************************/ /*****************************************************************************/
static void Att_PutIconsInListOfAttEvents (void *Events) static void Att_PutIconsInListOfEvents (void *Events)
{ {
bool ICanEdit; bool ICanEdit;
@ -350,7 +350,7 @@ static void Att_PutIconsInListOfAttEvents (void *Events)
ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH || ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM);
if (ICanEdit) if (ICanEdit)
Att_PutIconToCreateNewAttEvent ((struct Att_Events *) Events); Att_PutIconToCreateNewEvent ((struct Att_Events *) Events);
/***** Put icon to show attendance list *****/ /***** Put icon to show attendance list *****/
if (((struct Att_Events *) Events)->Num) if (((struct Att_Events *) Events)->Num)
@ -385,23 +385,23 @@ static void Att_PutIconsInListOfAttEvents (void *Events)
/**************** Put icon to create a new attendance event ******************/ /**************** 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, Ico_PutContextualIconToAdd (ActFrmNewAtt,NULL,
Att_PutParsToCreateNewAttEvent,Events); Att_PutParsToCreateNewEvent,Events);
} }
/*****************************************************************************/ /*****************************************************************************/
/**************** Put button to create a new attendance event ****************/ /**************** 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; extern const char *Txt_New_event;
/***** Begin form *****/ /***** Begin form *****/
Frm_BeginForm (ActFrmNewAtt); Frm_BeginForm (ActFrmNewAtt);
Att_PutParsToCreateNewAttEvent (Events); Att_PutParsToCreateNewEvent (Events);
/***** Button to create new event *****/ /***** Button to create new event *****/
Btn_PutConfirmButton (Txt_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 **************/ /************** Put parameters to create a new attendance event **************/
/*****************************************************************************/ /*****************************************************************************/
static void Att_PutParsToCreateNewAttEvent (void *Events) static void Att_PutParsToCreateNewEvent (void *Events)
{ {
Grp_WhichGroups_t WhichGroups; Grp_WhichGroups_t WhichGroups;
@ -449,8 +449,8 @@ static void Att_PutParsToListUsrsAttendance (void *Events)
/*****************************************************************************/ /*****************************************************************************/
// Only Event->AttCod must be filled // Only Event->AttCod must be filled
static void Att_ShowOneAttEventRow (struct Att_Events *Events, static void Att_ShowOneEventRow (struct Att_Events *Events,
bool ShowOnlyThisAttEventComplete) bool ShowOnlyThisAttEventComplete)
{ {
extern const char *Txt_View_event; extern const char *Txt_View_event;
char *Anchor = NULL; char *Anchor = NULL;
@ -470,7 +470,7 @@ static void Att_ShowOneAttEventRow (struct Att_Events *Events,
{ {
HTM_TD_Begin ("rowspan=\"2\" class=\"CONTEXT_COL %s\"", HTM_TD_Begin ("rowspan=\"2\" class=\"CONTEXT_COL %s\"",
The_GetColorRows ()); The_GetColorRows ());
Att_PutFormsToRemEditOneAttEvent (Events,Anchor); Att_PutFormsToRemEditOneEvent (Events,Anchor);
HTM_TD_End (); HTM_TD_End ();
} }
@ -512,7 +512,7 @@ static void Att_ShowOneAttEventRow (struct Att_Events *Events,
else else
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ()); HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
HTM_ARTICLE_Begin (Anchor); 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_ARTICLE_End ();
HTM_TD_End (); HTM_TD_End ();
@ -539,11 +539,11 @@ static void Att_ShowOneAttEventRow (struct Att_Events *Events,
HTM_TD_Begin ("colspan=\"2\" class=\"LT\""); HTM_TD_Begin ("colspan=\"2\" class=\"LT\"");
else else
HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ()); HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ());
Att_WriteAttEventAuthor (&Events->Event); Att_WriteEventAuthor (&Events->Event);
HTM_TD_End (); HTM_TD_End ();
/* Text of the attendance event */ /* 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, Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
Description,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to recpectful HTML Description,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to recpectful HTML
ALn_InsertLinks (Description,Cns_MAX_BYTES_TEXT,60); // Insert links ALn_InsertLinks (Description,Cns_MAX_BYTES_TEXT,60); // Insert links
@ -552,7 +552,7 @@ static void Att_ShowOneAttEventRow (struct Att_Events *Events,
else else
HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ()); HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ());
if (Gbl.Crs.Grps.NumGrps) if (Gbl.Crs.Grps.NumGrps)
Att_GetAndWriteNamesOfGrpsAssociatedToAttEvent (&Events->Event); Att_GetAndWriteNamesOfGrpsAssociatedToEvent (&Events->Event);
HTM_DIV_Begin ("class=\"%s_%s\"", HTM_DIV_Begin ("class=\"%s_%s\"",
Events->Event.Hidden ? "DAT_LIGHT" : Events->Event.Hidden ? "DAT_LIGHT" :
@ -573,7 +573,7 @@ static void Att_ShowOneAttEventRow (struct Att_Events *Events,
/****************** Write the author of an attendance event ******************/ /****************** 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); 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 ***************/ /************** Put a link (form) to edit one attendance event ***************/
/*****************************************************************************/ /*****************************************************************************/
static void Att_PutFormsToRemEditOneAttEvent (struct Att_Events *Events, static void Att_PutFormsToRemEditOneEvent (struct Att_Events *Events,
const char *Anchor) const char *Anchor)
{ {
static Act_Action_t ActionHideUnhide[2] = static Act_Action_t ActionHideUnhide[2] =
{ {
@ -604,7 +604,7 @@ static void Att_PutFormsToRemEditOneAttEvent (struct Att_Events *Events,
[true ] = ActUnhAtt, // Hidden ==> action to unhide [true ] = ActUnhAtt, // Hidden ==> action to unhide
}; };
if (Att_CheckIfICanEditAttEvents ()) if (Att_CheckIfICanEditEvents ())
{ {
/***** Icon to remove attendance event *****/ /***** Icon to remove attendance event *****/
Ico_PutContextualIconToRemove (ActReqRemAtt,NULL, Ico_PutContextualIconToRemove (ActReqRemAtt,NULL,
@ -631,7 +631,7 @@ static void Att_PutFormsToRemEditOneAttEvent (struct Att_Events *Events,
/******************* Check if I can edit calls for exams *********************/ /******************* Check if I can edit calls for exams *********************/
/*****************************************************************************/ /*****************************************************************************/
bool Att_CheckIfICanEditAttEvents (void) bool Att_CheckIfICanEditEvents (void)
{ {
static const bool ICanEditAttEvents[Rol_NUM_ROLES] = static const bool ICanEditAttEvents[Rol_NUM_ROLES] =
{ {
@ -664,8 +664,8 @@ static void Att_PutPars (void *Events)
/************************ List all attendance events *************************/ /************************ List all attendance events *************************/
/*****************************************************************************/ /*****************************************************************************/
static void Att_GetListAttEvents (struct Att_Events *Events, static void Att_GetListEvents (struct Att_Events *Events,
Att_OrderNewestOldest_t OrderNewestOldest) Att_OrderNewestOldest_t OrderNewestOldest)
{ {
extern unsigned (*Att_DB_GetListAttEvents[Grp_NUM_WHICH_GROUPS]) (MYSQL_RES **mysql_res, extern unsigned (*Att_DB_GetListAttEvents[Grp_NUM_WHICH_GROUPS]) (MYSQL_RES **mysql_res,
Dat_StartEndTime_t SelectedOrder, Dat_StartEndTime_t SelectedOrder,
@ -674,7 +674,7 @@ static void Att_GetListAttEvents (struct Att_Events *Events,
unsigned NumAttEvent; unsigned NumAttEvent;
if (Events->LstIsRead) if (Events->LstIsRead)
Att_FreeListAttEvents (Events); Att_FreeListEvents (Events);
/***** Get list of attendance events from database *****/ /***** Get list of attendance events from database *****/
Events->Num = Att_DB_GetListAttEvents[Gbl.Crs.Grps.WhichGrps] (&mysql_res, 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 *********/ /********* 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) if (Event->CrsCod != Gbl.Hierarchy.Crs.CrsCod)
Err_WrongEventExit (); Err_WrongEventExit ();
@ -725,7 +725,7 @@ static void Att_GetDataOfAttEventByCodAndCheckCrs (struct Att_Event *Event)
// Returns true if attendance event exists // Returns true if attendance event exists
// This function can be called from web service, so do not display messages // 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_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -733,12 +733,12 @@ bool Att_GetDataOfAttEventByCod (struct Att_Event *Event)
bool Found = false; bool Found = false;
/***** Reset attendance event data *****/ /***** Reset attendance event data *****/
Att_ResetAttendanceEvent (Event); Att_ResetEvent (Event);
if (Event->AttCod > 0) if (Event->AttCod > 0)
{ {
/***** Build query *****/ /***** 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 *****/ /***** Get data of attendance event from database *****/
if ((Found = (NumAttEvents != 0))) // Attendance event found... if ((Found = (NumAttEvents != 0))) // Attendance event found...
@ -747,7 +747,7 @@ bool Att_GetDataOfAttEventByCod (struct Att_Event *Event)
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
/* Get attendance event (except Txt) */ /* Get attendance event (except Txt) */
Att_GetAttendanceEventDataFromRow (row,Event); Att_GetEventDataFromRow (row,Event);
} }
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
@ -761,7 +761,7 @@ bool Att_GetDataOfAttEventByCod (struct Att_Event *Event)
/********************** Clear all attendance event data **********************/ /********************** 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 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 *************************/ /************************* 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]) *****/ /***** Get code of attendance event (row[0]) and code of course (row[1]) *****/
Event->AttCod = Str_ConvertStrCodToLongCod (row[0]); 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 ***********************/ /********************** 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) 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 ***********/ /********* 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_Do_you_really_want_to_remove_the_event_X;
extern const char *Txt_Remove_event; extern const char *Txt_Remove_event;
@ -846,7 +846,7 @@ void Att_AskRemAttEvent (void)
Events.Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att); Events.Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att);
/***** Get data of the attendance event from database *****/ /***** Get data of the attendance event from database *****/
Att_GetDataOfAttEventByCodAndCheckCrs (&Events.Event); Att_GetEventDataByCodAndCheckCrs (&Events.Event);
/***** Show question and button to remove event *****/ /***** Show question and button to remove event *****/
Ale_ShowAlertAndButton (ActRemAtt,NULL,NULL, Ale_ShowAlertAndButton (ActRemAtt,NULL,NULL,
@ -856,14 +856,14 @@ void Att_AskRemAttEvent (void)
Events.Event.Title); Events.Event.Title);
/***** Show attendance events again *****/ /***** Show attendance events again *****/
Att_SeeAttEvents (); Att_SeeEvents ();
} }
/*****************************************************************************/ /*****************************************************************************/
/** Get param., remove an attendance event and show attendance events again **/ /** 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; extern const char *Txt_Event_X_removed;
struct Att_Event Event; struct Att_Event Event;
@ -873,40 +873,40 @@ void Att_GetAndRemAttEvent (void)
/***** Get data of the attendance event from database *****/ /***** Get data of the attendance event from database *****/
// Inside this function, the course is checked to be the current one // Inside this function, the course is checked to be the current one
Att_GetDataOfAttEventByCodAndCheckCrs (&Event); Att_GetEventDataByCodAndCheckCrs (&Event);
/***** Remove the attendance event from database *****/ /***** Remove the attendance event from database *****/
Att_RemoveAttEventFromDB (Event.AttCod); Att_RemoveEventFromDB (Event.AttCod);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
Ale_ShowAlert (Ale_SUCCESS,Txt_Event_X_removed, Ale_ShowAlert (Ale_SUCCESS,Txt_Event_X_removed,
Event.Title); Event.Title);
/***** Show attendance events again *****/ /***** Show attendance events again *****/
Att_SeeAttEvents (); Att_SeeEvents ();
} }
/*****************************************************************************/ /*****************************************************************************/
/**************** Remove an attendance event from database *******************/ /**************** Remove an attendance event from database *******************/
/*****************************************************************************/ /*****************************************************************************/
void Att_RemoveAttEventFromDB (long AttCod) void Att_RemoveEventFromDB (long AttCod)
{ {
/***** Remove users registered in the attendance event *****/ /***** Remove users registered in the attendance event *****/
Att_DB_RemoveAllUsrsFromAnAttEvent (AttCod); Att_DB_RemoveAllUsrsFromAnEvent (AttCod);
/***** Remove all groups of this attendance event *****/ /***** Remove all groups of this attendance event *****/
Att_DB_RemoveGrpsAssociatedToAnAttEvent (AttCod); Att_DB_RemoveGrpsAssociatedToAnEvent (AttCod);
/***** Remove attendance event *****/ /***** Remove attendance event *****/
Att_DB_RemoveAttEventFromCurrentCrs (AttCod); Att_DB_RemoveEventFromCurrentCrs (AttCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************* Hide an attendance event **************************/ /************************* Hide an attendance event **************************/
/*****************************************************************************/ /*****************************************************************************/
void Att_HideAttEvent (void) void Att_HideEvent (void)
{ {
struct Att_Event Event; struct Att_Event Event;
@ -914,20 +914,20 @@ void Att_HideAttEvent (void)
Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att); Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att);
/***** Get data of the attendance event from database *****/ /***** Get data of the attendance event from database *****/
Att_GetDataOfAttEventByCodAndCheckCrs (&Event); Att_GetEventDataByCodAndCheckCrs (&Event);
/***** Hide attendance event *****/ /***** Hide attendance event *****/
Att_DB_HideOrUnhideAttEvent (Event.AttCod,true); Att_DB_HideOrUnhideEvent (Event.AttCod,true);
/***** Show attendance events again *****/ /***** Show attendance events again *****/
Att_SeeAttEvents (); Att_SeeEvents ();
} }
/*****************************************************************************/ /*****************************************************************************/
/************************ Unhide an attendance event *************************/ /************************ Unhide an attendance event *************************/
/*****************************************************************************/ /*****************************************************************************/
void Att_UnhideAttEvent (void) void Att_UnhideEvent (void)
{ {
struct Att_Event Event; struct Att_Event Event;
@ -935,20 +935,20 @@ void Att_UnhideAttEvent (void)
Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att); Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att);
/***** Get data of the attendance event from database *****/ /***** Get data of the attendance event from database *****/
Att_GetDataOfAttEventByCodAndCheckCrs (&Event); Att_GetEventDataByCodAndCheckCrs (&Event);
/***** Unhide attendance event *****/ /***** Unhide attendance event *****/
Att_DB_HideOrUnhideAttEvent (Event.AttCod,false); Att_DB_HideOrUnhideEvent (Event.AttCod,false);
/***** Show attendance events again *****/ /***** Show attendance events again *****/
Att_SeeAttEvents (); Att_SeeEvents ();
} }
/*****************************************************************************/ /*****************************************************************************/
/*************** Put a form to create a new attendance event *****************/ /*************** 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_new_event;
extern const char *Hlp_USERS_Attendance_edit_event; extern const char *Hlp_USERS_Attendance_edit_event;
@ -987,7 +987,7 @@ void Att_ReqCreatOrEditAttEvent (void)
{ {
/* Reset attendance event data */ /* Reset attendance event data */
Events.Event.AttCod = -1L; Events.Event.AttCod = -1L;
Att_ResetAttendanceEvent (&Events.Event); Att_ResetEvent (&Events.Event);
/* Initialize some fields */ /* Initialize some fields */
Events.Event.CrsCod = Gbl.Hierarchy.Crs.CrsCod; Events.Event.CrsCod = Gbl.Hierarchy.Crs.CrsCod;
@ -999,10 +999,10 @@ void Att_ReqCreatOrEditAttEvent (void)
else else
{ {
/* Get data of the attendance event from database */ /* Get data of the attendance event from database */
Att_GetDataOfAttEventByCodAndCheckCrs (&Events.Event); Att_GetEventDataByCodAndCheckCrs (&Events.Event);
/* Get text of the attendance event from database */ /* Get text of the attendance event from database */
Att_DB_GetAttEventDescription (Events.Event.AttCod,Description); Att_DB_GetEventDescription (Events.Event.AttCod,Description);
} }
/***** Begin form *****/ /***** Begin form *****/
@ -1092,7 +1092,7 @@ void Att_ReqCreatOrEditAttEvent (void)
HTM_TR_End (); HTM_TR_End ();
/***** Groups *****/ /***** Groups *****/
Att_ShowLstGrpsToEditAttEvent (Events.Event.AttCod); Att_ShowLstGrpsToEditEvent (Events.Event.AttCod);
/***** End table, send button and end box *****/ /***** End table, send button and end box *****/
if (ItsANewAttEvent) if (ItsANewAttEvent)
@ -1104,15 +1104,15 @@ void Att_ReqCreatOrEditAttEvent (void)
Frm_EndForm (); Frm_EndForm ();
/***** Show current attendance events *****/ /***** Show current attendance events *****/
Att_GetListAttEvents (&Events,Att_NEWEST_FIRST); Att_GetListEvents (&Events,Att_NEWEST_FIRST);
Att_ShowAllAttEvents (&Events); Att_ShowAllEvents (&Events);
} }
/*****************************************************************************/ /*****************************************************************************/
/************* Show list of groups to edit and attendance event **************/ /************* 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_Groups;
extern const char *Txt_The_whole_course; 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 ***************/ /*************** 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_Already_existed_an_event_with_the_title_X;
extern const char *Txt_Created_new_event_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 */ /* Get data of the old (current) attendance event from database */
OldAtt.AttCod = ReceivedAtt.AttCod; OldAtt.AttCod = ReceivedAtt.AttCod;
Att_GetDataOfAttEventByCodAndCheckCrs (&OldAtt); Att_GetEventDataByCodAndCheckCrs (&OldAtt);
ReceivedAtt.Hidden = OldAtt.Hidden; ReceivedAtt.Hidden = OldAtt.Hidden;
} }
@ -1222,7 +1222,7 @@ void Att_ReceiveFormAttEvent (void)
if (ReceivedAtt.Title[0]) // If there's an attendance event title if (ReceivedAtt.Title[0]) // If there's an attendance event title
{ {
/* If title of attendance event was in database... */ /* 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; ReceivedAttEventIsCorrect = false;
@ -1245,7 +1245,7 @@ void Att_ReceiveFormAttEvent (void)
if (ItsANewAttEvent) if (ItsANewAttEvent)
{ {
ReceivedAtt.Hidden = false; // New attendance events are visible by default 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 *****/ /***** Write success message *****/
Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_event_X, Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_event_X,
@ -1253,7 +1253,7 @@ void Att_ReceiveFormAttEvent (void)
} }
else else
{ {
Att_UpdateAttEvent (&ReceivedAtt,Description); Att_UpdateEvent (&ReceivedAtt,Description);
/***** Write success message *****/ /***** Write success message *****/
Ale_ShowAlert (Ale_SUCCESS,Txt_The_event_has_been_modified); Ale_ShowAlert (Ale_SUCCESS,Txt_The_event_has_been_modified);
@ -1263,20 +1263,20 @@ void Att_ReceiveFormAttEvent (void)
Grp_FreeListCodSelectedGrps (); Grp_FreeListCodSelectedGrps ();
} }
else else
Att_ReqCreatOrEditAttEvent (); Att_ReqCreatOrEditEvent ();
/***** Show attendance events again *****/ /***** Show attendance events again *****/
Att_SeeAttEvents (); Att_SeeEvents ();
} }
/*****************************************************************************/ /*****************************************************************************/
/********************* Create a new attendance event *************************/ /********************* 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 *****/ /***** Create a new attendance event *****/
Event->AttCod = Att_DB_CreateAttEvent (Event,Description); Event->AttCod = Att_DB_CreateEvent (Event,Description);
/***** Create groups *****/ /***** Create groups *****/
if (Gbl.Crs.Grps.LstGrpsSel.NumGrps) 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 **********************/ /****************** 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 *****/ /***** Update the data of the attendance event *****/
Att_DB_UpdateAttEvent (Event,Description); Att_DB_UpdateEvent (Event,Description);
/***** Update groups *****/ /***** Update groups *****/
/* Remove old groups */ /* Remove old groups */
Att_DB_RemoveGrpsAssociatedToAnAttEvent (Event->AttCod); Att_DB_RemoveGrpsAssociatedToAnEvent (Event->AttCod);
/* Create new groups */ /* Create new groups */
if (Gbl.Crs.Grps.LstGrpsSel.NumGrps) 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 *********/ /****** 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_Group;
extern const char *Txt_Groups; extern const char *Txt_Groups;
@ -1389,16 +1389,16 @@ static void Att_GetAndWriteNamesOfGrpsAssociatedToAttEvent (struct Att_Event *Ev
/***************** Remove all attendance events of a course ******************/ /***************** Remove all attendance events of a course ******************/
/*****************************************************************************/ /*****************************************************************************/
void Att_RemoveCrsAttEvents (long CrsCod) void Att_RemoveCrsEvents (long CrsCod)
{ {
/***** Remove students *****/ /***** Remove students *****/
Att_DB_RemoveUsrsFromCrsAttEvents (CrsCod); Att_DB_RemoveUsrsFromCrsEvents (CrsCod);
/***** Remove groups *****/ /***** Remove groups *****/
Att_DB_RemoveGrpsAssociatedToCrsAttEvents (CrsCod); Att_DB_RemoveGrpsAssociatedToCrsEvents (CrsCod);
/***** Remove attendance events *****/ /***** 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 // Returns the number of attendance events
// in this location (all the platform, the current degree or the current course) // 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_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -1418,7 +1418,7 @@ unsigned Att_GetNumAttEvents (HieLvl_Level_t Scope,unsigned *NumNotif)
*NumNotif = 0; *NumNotif = 0;
/***** Get number of attendance events from database *****/ /***** 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 *****/ /***** Get number of attendance events *****/
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
@ -1441,7 +1441,7 @@ unsigned Att_GetNumAttEvents (HieLvl_Level_t Scope,unsigned *NumNotif)
/************************ Show one attendance event **************************/ /************************ Show one attendance event **************************/
/*****************************************************************************/ /*****************************************************************************/
void Att_SeeOneAttEvent (void) void Att_SeeOneEvent (void)
{ {
struct Att_Events Events; struct Att_Events Events;
@ -1466,27 +1466,27 @@ static void Att_ShowEvent (struct Att_Events *Events)
Events->CurrentPage = Pag_GetParPagNum (Pag_ATT_EVENTS); Events->CurrentPage = Pag_GetParPagNum (Pag_ATT_EVENTS);
/***** Get data of this attendance event *****/ /***** Get data of this attendance event *****/
Att_GetDataOfAttEventByCodAndCheckCrs (&Events->Event); Att_GetEventDataByCodAndCheckCrs (&Events->Event);
Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInAttEvent (Events->Event.AttCod); Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInEvent (Events->Event.AttCod);
/***** Show attendance event inside a box *****/ /***** Show attendance event inside a box *****/
Box_BoxTableBegin (NULL,Txt_Event, Box_BoxTableBegin (NULL,Txt_Event,
Att_PutIconsOneAtt,Events, Att_PutIconsOneEvent,Events,
Hlp_USERS_Attendance,Box_NOT_CLOSABLE,2); Hlp_USERS_Attendance,Box_NOT_CLOSABLE,2);
Att_ShowOneAttEventRow (Events, Att_ShowOneEventRow (Events,
true); // Show only this event true); // Show only this event
Box_BoxTableEnd (); Box_BoxTableEnd ();
switch (Gbl.Usrs.Me.Role.Logged) switch (Gbl.Usrs.Me.Role.Logged)
{ {
case Rol_STD: case Rol_STD:
Att_ListAttOnlyMeAsStudent (&Events->Event); Att_ListEventOnlyMeAsStudent (&Events->Event);
break; break;
case Rol_NET: case Rol_NET:
case Rol_TCH: case Rol_TCH:
case Rol_SYS_ADM: case Rol_SYS_ADM:
/***** Show list of students *****/ /***** Show list of students *****/
Att_ListAttStudents (Events); Att_ListEventStudents (Events);
break; break;
default: default:
break; break;
@ -1497,7 +1497,7 @@ static void Att_ShowEvent (struct Att_Events *Events)
/*************** Put contextual icons in an attendance event *****************/ /*************** Put contextual icons in an attendance event *****************/
/*****************************************************************************/ /*****************************************************************************/
static void Att_PutIconsOneAtt (void *Events) static void Att_PutIconsOneEvent (void *Events)
{ {
char *Anchor = NULL; char *Anchor = NULL;
@ -1505,7 +1505,7 @@ static void Att_PutIconsOneAtt (void *Events)
Frm_SetAnchorStr (((struct Att_Events *) Events)->Event.AttCod,&Anchor); Frm_SetAnchorStr (((struct Att_Events *) Events)->Event.AttCod,&Anchor);
/***** Put icons to edit resource link *****/ /***** Put icons to edit resource link *****/
Att_PutFormsToRemEditOneAttEvent ((struct Att_Events *) Events,Anchor); Att_PutFormsToRemEditOneEvent ((struct Att_Events *) Events,Anchor);
/***** Free anchor string *****/ /***** Free anchor string *****/
Frm_FreeAnchorStr (Anchor); Frm_FreeAnchorStr (Anchor);
@ -1516,7 +1516,7 @@ static void Att_PutIconsOneAtt (void *Events)
/*****************************************************************************/ /*****************************************************************************/
// Event must be filled before calling this function // 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 *Hlp_USERS_Attendance;
extern const char *Txt_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 // 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 *Hlp_USERS_Attendance;
extern const char *Txt_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 *****/ /***** 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 *****/ /***** Begin table row *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -1856,8 +1856,8 @@ static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr,
/**************** Put link to view one attendance event **********************/ /**************** Put link to view one attendance event **********************/
/*****************************************************************************/ /*****************************************************************************/
static void Att_PutLinkAttEvent (struct Att_Event *Event, static void Att_PutLinkEvent (struct Att_Event *Event,
const char *Title,const char *Txt) const char *Title,const char *Txt)
{ {
/***** Begin form *****/ /***** Begin form *****/
Frm_BeginForm (ActSeeOneAtt); Frm_BeginForm (ActSeeOneAtt);
@ -1935,7 +1935,7 @@ void Att_PutParsCodGrps (long AttCod)
/*************** Save me as students who attended to an event ****************/ /*************** 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; extern const char *Txt_Your_comment_has_been_updated;
struct Att_Events Events; struct Att_Events Events;
@ -1949,12 +1949,12 @@ void Att_RegisterMeAsStdInAttEvent (void)
/***** Get attendance event code *****/ /***** Get attendance event code *****/
Events.Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att); 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) if (Events.Event.Open)
{ {
/***** Get comments for this student *****/ /***** 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); CommentStd,CommentTch);
if (asprintf (&ParName,"CommentStd%s",Gbl.Usrs.Me.UsrDat.EnUsrCod) < 0) if (asprintf (&ParName,"CommentStd%s",Gbl.Usrs.Me.UsrDat.EnUsrCod) < 0)
Err_NotEnoughMemoryExit (); Err_NotEnoughMemoryExit ();
@ -1965,11 +1965,11 @@ void Att_RegisterMeAsStdInAttEvent (void)
CommentStd[0] || CommentStd[0] ||
CommentTch[0]) CommentTch[0])
/***** Register student *****/ /***** 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); Present,CommentStd,CommentTch);
else else
/***** Remove student *****/ /***** 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 *****/ /***** Write final message *****/
Ale_ShowAlert (Ale_SUCCESS,Txt_Your_comment_has_been_updated); 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 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 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_Presents;
extern const char *Txt_Absents; extern const char *Txt_Absents;
@ -2012,7 +2012,7 @@ void Att_RegisterStudentsInAttEvent (void)
/***** Get attendance event code *****/ /***** Get attendance event code *****/
Events.Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att); 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 *****/ /***** Get groups selected *****/
Grp_GetParCodsSeveralGrpsToShowUsrs (); Grp_GetParCodsSeveralGrpsToShowUsrs ();
@ -2070,7 +2070,7 @@ void Att_RegisterStudentsInAttEvent (void)
NumUsr++) NumUsr++)
{ {
/***** Get comments for this student *****/ /***** Get comments for this student *****/
Att_CheckIfUsrIsPresentInAttEventAndGetComments (Events.Event.AttCod, Att_CheckIfUsrIsPresentInEventAndGetComments (Events.Event.AttCod,
Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod, Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod,
CommentStd, CommentStd,
CommentTch); CommentTch);
@ -2086,11 +2086,11 @@ void Att_RegisterStudentsInAttEvent (void)
CommentStd[0] || CommentStd[0] ||
CommentTch[0]) CommentTch[0])
/***** Register student *****/ /***** 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); Present,CommentStd,CommentTch);
else else
/***** Remove student *****/ /***** 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) if (Present)
NumStdsPresent++; NumStdsPresent++;
@ -2122,9 +2122,9 @@ void Att_RegisterStudentsInAttEvent (void)
/********* Get number of users from a list who attended to an event **********/ /********* Get number of users from a list who attended to an event **********/
/*****************************************************************************/ /*****************************************************************************/
static unsigned Att_GetNumUsrsFromAListWhoAreInAttEvent (long AttCod, static unsigned Att_GetNumUsrsFromAListWhoAreInEvent (long AttCod,
long LstSelectedUsrCods[], long LstSelectedUsrCods[],
unsigned NumUsrsInList) unsigned NumUsrsInList)
{ {
char *SubQueryUsrs; char *SubQueryUsrs;
unsigned NumUsrsInAttEvent; unsigned NumUsrsInAttEvent;
@ -2136,7 +2136,7 @@ static unsigned Att_GetNumUsrsFromAListWhoAreInAttEvent (long AttCod,
&SubQueryUsrs); &SubQueryUsrs);
/***** Get number of users from list in attendance event from database ****/ /***** 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 *****/ /***** Free memory for subquery string *****/
Usr_FreeSubqueryUsrCods (SubQueryUsrs); Usr_FreeSubqueryUsrCods (SubQueryUsrs);
@ -2151,7 +2151,7 @@ static unsigned Att_GetNumUsrsFromAListWhoAreInAttEvent (long AttCod,
/***************** Check if a student attended to an event *******************/ /***************** 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; bool Present;
@ -2164,7 +2164,7 @@ static bool Att_CheckIfUsrIsPresentInAttEvent (long AttCod,long UsrCod)
/***************** Check if a student attended to an event *******************/ /***************** 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 CommentStd[Cns_MAX_BYTES_TEXT + 1],
char CommentTch[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); Att_ResetEvents (&Events);
/***** Get list of attendance 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 *****/ /***** List users to select some of them *****/
Usr_PutFormToSelectUsrsToGoToAct (&Gbl.Usrs.Selected, Usr_PutFormToSelectUsrsToGoToAct (&Gbl.Usrs.Selected,
@ -2236,7 +2236,7 @@ static void Att_ReqListOrPrintUsrsAttendanceCrs (void *TypeOfView)
false); // Do not put form with date range false); // Do not put form with date range
/***** Free list of attendance events *****/ /***** Free list of attendance events *****/
Att_FreeListAttEvents (&Events); Att_FreeListEvents (&Events);
break; break;
default: default:
Err_WrongTypeExit (); Err_WrongTypeExit ();
@ -2273,7 +2273,7 @@ static void Att_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView)
Att_ResetEvents (&Events); Att_ResetEvents (&Events);
/***** Get list of attendance 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 *****/ /***** Get boolean parameter that indicates if details must be shown *****/
Events.ShowDetails = Par_GetParBool ("ShowDetails"); Events.ShowDetails = Par_GetParBool ("ShowDetails");
@ -2287,7 +2287,7 @@ static void Att_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView)
NumAttEvent++) NumAttEvent++)
/* Get number of students in this event */ /* Get number of students in this event */
Events.Lst[NumAttEvent].NumStdsFromList = Events.Lst[NumAttEvent].NumStdsFromList =
Att_GetNumUsrsFromAListWhoAreInAttEvent (Events.Lst[NumAttEvent].AttCod, Att_GetNumUsrsFromAListWhoAreInEvent (Events.Lst[NumAttEvent].AttCod,
&Gbl.Usrs.Me.UsrDat.UsrCod,1); &Gbl.Usrs.Me.UsrDat.UsrCod,1);
/***** Get list of attendance events selected *****/ /***** Get list of attendance events selected *****/
@ -2334,7 +2334,7 @@ static void Att_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView)
Grp_FreeListCodSelectedGrps (); Grp_FreeListCodSelectedGrps ();
/***** Free list of attendance events *****/ /***** Free list of attendance events *****/
Att_FreeListAttEvents (&Events); Att_FreeListEvents (&Events);
break; break;
default: default:
Err_WrongTypeExit (); Err_WrongTypeExit ();
@ -2395,7 +2395,7 @@ static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView)
Usr_GetListSelectedUsrCods (&Gbl.Usrs.Selected,NumUsrsInList,&LstSelectedUsrCods); Usr_GetListSelectedUsrCods (&Gbl.Usrs.Selected,NumUsrsInList,&LstSelectedUsrCods);
/***** Get list of attendance events *****/ /***** Get list of attendance events *****/
Att_GetListAttEvents (&Events,Att_OLDEST_FIRST); Att_GetListEvents (&Events,Att_OLDEST_FIRST);
/***** Get number of students in each event *****/ /***** Get number of students in each event *****/
for (NumAttEvent = 0; for (NumAttEvent = 0;
@ -2403,7 +2403,7 @@ static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView)
NumAttEvent++) NumAttEvent++)
/* Get number of students in this event */ /* Get number of students in this event */
Events.Lst[NumAttEvent].NumStdsFromList = Events.Lst[NumAttEvent].NumStdsFromList =
Att_GetNumUsrsFromAListWhoAreInAttEvent (Events.Lst[NumAttEvent].AttCod, Att_GetNumUsrsFromAListWhoAreInEvent (Events.Lst[NumAttEvent].AttCod,
LstSelectedUsrCods,NumUsrsInList); LstSelectedUsrCods,NumUsrsInList);
/***** Get list of attendance events selected *****/ /***** Get list of attendance events selected *****/
@ -2447,7 +2447,7 @@ static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView)
free (Events.StrAttCodsSelected); free (Events.StrAttCodsSelected);
/***** Free list of attendance events *****/ /***** Free list of attendance events *****/
Att_FreeListAttEvents (&Events); Att_FreeListEvents (&Events);
/***** Free list of user codes *****/ /***** Free list of user codes *****/
Usr_FreeListSelectedUsrCods (LstSelectedUsrCods); Usr_FreeListSelectedUsrCods (LstSelectedUsrCods);
@ -2718,8 +2718,8 @@ static void Att_ListEventsToSelect (struct Att_Events *Events,
{ {
/* Get data of the attendance event from database */ /* Get data of the attendance event from database */
Events->Event.AttCod = Events->Lst[NumAttEvent].AttCod; Events->Event.AttCod = Events->Lst[NumAttEvent].AttCod;
Att_GetDataOfAttEventByCodAndCheckCrs (&Events->Event); Att_GetEventDataByCodAndCheckCrs (&Events->Event);
Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInAttEvent (Events->Event.AttCod); Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInEvent (Events->Event.AttCod);
/* Write a row for this event */ /* Write a row for this event */
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -2932,12 +2932,12 @@ static void Att_WriteTableHeadSeveralAttEvents (struct Att_Events *Events)
{ {
/***** Get data of this attendance event *****/ /***** Get data of this attendance event *****/
Events->Event.AttCod = Events->Lst[NumAttEvent].AttCod; Events->Event.AttCod = Events->Lst[NumAttEvent].AttCod;
Att_GetDataOfAttEventByCodAndCheckCrs (&Events->Event); Att_GetEventDataByCodAndCheckCrs (&Events->Event);
/***** Put link to this attendance event *****/ /***** Put link to this attendance event *****/
HTM_TH_Begin (HTM_HEAD_CENTER); HTM_TH_Begin (HTM_HEAD_CENTER);
snprintf (StrNumAttEvent,sizeof (StrNumAttEvent),"%u",NumAttEvent + 1); snprintf (StrNumAttEvent,sizeof (StrNumAttEvent),"%u",NumAttEvent + 1);
Att_PutLinkAttEvent (&Events->Event, Att_PutLinkEvent (&Events->Event,
Events->Event.Title, Events->Event.Title,
StrNumAttEvent); StrNumAttEvent);
HTM_TH_End (); 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 */ /* Check if this student is already registered in the current event */
// Here it is not necessary to get comments // Here it is not necessary to get comments
Present = Att_CheckIfUsrIsPresentInAttEvent (Events->Lst[NumAttEvent].AttCod, Present = Att_CheckIfUsrIsPresentInEvent (Events->Lst[NumAttEvent].AttCod,
UsrDat->UsrCod); UsrDat->UsrCod);
/* Write check or cross */ /* Write check or cross */
@ -3195,11 +3195,11 @@ static void Att_ListAttEventsForAStd (struct Att_Events *Events,
{ {
/***** Get data of the attendance event from database *****/ /***** Get data of the attendance event from database *****/
Events->Event.AttCod = Events->Lst[NumAttEvent].AttCod; Events->Event.AttCod = Events->Lst[NumAttEvent].AttCod;
Att_GetDataOfAttEventByCodAndCheckCrs (&Events->Event); Att_GetEventDataByCodAndCheckCrs (&Events->Event);
Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInAttEvent (Events->Event.AttCod); Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInEvent (Events->Event.AttCod);
/***** Get comments for this student *****/ /***** 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]; ShowCommentStd = CommentStd[0];
ShowCommentTch = CommentTch[0] && ShowCommentTch = CommentTch[0] &&
(Gbl.Usrs.Me.Role.Logged == Rol_TCH || (Gbl.Usrs.Me.Role.Logged == Rol_TCH ||

View File

@ -83,34 +83,34 @@ struct Att_Events
/***************************** Public prototypes *****************************/ /***************************** Public prototypes *****************************/
/*****************************************************************************/ /*****************************************************************************/
void Att_SeeAttEvents (void); void Att_SeeEvents (void);
bool Att_CheckIfICanEditAttEvents (void); bool Att_CheckIfICanEditEvents (void);
void Att_ReqCreatOrEditAttEvent (void); void Att_ReqCreatOrEditEvent (void);
bool Att_GetDataOfAttEventByCod (struct Att_Event *Event); bool Att_GetEventDataByCod (struct Att_Event *Event);
void Att_GetAttendanceEventDataFromRow (MYSQL_ROW row,struct Att_Event *Event); void Att_GetEventDataFromRow (MYSQL_ROW row,struct Att_Event *Event);
void Att_AskRemAttEvent (void); void Att_AskRemEvent (void);
void Att_GetAndRemAttEvent (void); void Att_GetAndRemEvent (void);
void Att_RemoveAttEventFromDB (long AttCod); void Att_RemoveEventFromDB (long AttCod);
void Att_HideAttEvent (void); void Att_HideEvent (void);
void Att_UnhideAttEvent (void); void Att_UnhideEvent (void);
void Att_ReceiveFormAttEvent (void); void Att_ReceiveFormEvent (void);
void Att_CreateAttEvent (struct Att_Event *Event,const char *Description); void Att_CreateEvent (struct Att_Event *Event,const char *Description);
void Att_UpdateAttEvent (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_PutParsCodGrps (long AttCod);
void Att_RegisterMeAsStdInAttEvent (void); void Att_RegisterMeAsStdInEvent (void);
void Att_RegisterStudentsInAttEvent (void); void Att_RegisterStudentsInEvent (void);
void Att_ReqListUsrsAttendanceCrs (void); void Att_ReqListUsrsAttendanceCrs (void);
void Att_ListMyAttendanceCrs (void); void Att_ListMyAttendanceCrs (void);

View File

@ -52,8 +52,8 @@ unsigned (*Att_DB_GetListAttEvents[Grp_NUM_WHICH_GROUPS]) (MYSQL_RES **mysql_res
Dat_StartEndTime_t SelectedOrder, Dat_StartEndTime_t SelectedOrder,
Att_OrderNewestOldest_t OrderNewestOldest) = Att_OrderNewestOldest_t OrderNewestOldest) =
{ {
[Grp_MY_GROUPS ] = Att_DB_GetListAttEventsMyGrps, [Grp_MY_GROUPS ] = Att_DB_GetListEventsMyGrps,
[Grp_ALL_GROUPS] = Att_DB_GetListAttEventsAllGrps, [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_INS_ADM] = " AND Hidden='N'",
[Rol_SYS_ADM] = "", [Rol_SYS_ADM] = "",
}; };
static const char *Att_DB_OrderBySubQuery[Dat_NUM_START_END_TIME][Att_NUM_ORDERS_NEWEST_OLDEST] = static const char *Att_DB_OrderBySubQuery[Dat_NUM_START_END_TIME][Att_NUM_ORDERS_NEWEST_OLDEST] =
{ {
[Dat_STR_TIME][Att_NEWEST_FIRST] = "StartTime DESC," [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," [Dat_STR_TIME][Att_OLDEST_FIRST] = "StartTime,"
"EndTime," "EndTime,"
"Title", "Title",
[Dat_END_TIME][Att_NEWEST_FIRST] = "EndTime DESC," [Dat_END_TIME][Att_NEWEST_FIRST] = "EndTime DESC,"
"StartTime DESC," "StartTime DESC,"
"Title DESC", "Title DESC",
[Dat_END_TIME][Att_OLDEST_FIRST] = "EndTime," [Dat_END_TIME][Att_OLDEST_FIRST] = "EndTime,"
"StartTime," "StartTime,"
"Title", "Title",
}; };
/*****************************************************************************/ /*****************************************************************************/
/**************** Get list of attendance events in my groups *****************/ /**************** Get list of attendance events in my groups *****************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Att_DB_GetListAttEventsMyGrps (MYSQL_RES **mysql_res, unsigned Att_DB_GetListEventsMyGrps (MYSQL_RES **mysql_res,
Dat_StartEndTime_t SelectedOrder, Dat_StartEndTime_t SelectedOrder,
Att_OrderNewestOldest_t OrderNewestOldest) Att_OrderNewestOldest_t OrderNewestOldest)
{ {
return (unsigned) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get attendance events", 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 *********************/ /********************* Get list of all attendance events *********************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Att_DB_GetListAttEventsAllGrps (MYSQL_RES **mysql_res, unsigned Att_DB_GetListEventsAllGrps (MYSQL_RES **mysql_res,
Dat_StartEndTime_t SelectedOrder, Dat_StartEndTime_t SelectedOrder,
Att_OrderNewestOldest_t OrderNewestOldest) Att_OrderNewestOldest_t OrderNewestOldest)
{ {
return (unsigned) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get attendance events", 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 *********************/ /********************* 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get attendance events", 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 *******************/ /**************** 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get attendance event data", 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 ******************/ /***************** Get attendance event title from database ******************/
/*****************************************************************************/ /*****************************************************************************/
void Att_DB_GetAttEventTitle (long AttCod, void Att_DB_GetEventTitle (long AttCod,
char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1]) char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1])
{ {
DB_QuerySELECTString (Title,Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE, DB_QuerySELECTString (Title,Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE,
"can not get 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 *******************/ /***************** 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", DB_QuerySELECTString (Description,Cns_MAX_BYTES_TEXT,"can not get attendance event text",
"SELECT Txt" // row[0] "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 ********/ /***** 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 return
DB_QueryEXISTS ("can not check similar attendance events", 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 *************************/ /********************* 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 return
DB_QueryINSERTandReturnCode ("can not create new attendance event", 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 *******************/ /****************** 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", DB_QueryUPDATE ("can not update attendance event",
"UPDATE att_events" "UPDATE att_events"
@ -299,7 +299,7 @@ void Att_DB_UpdateAttEvent (const struct Att_Event *Event,const char *Descriptio
/********************** Hide/unhide an attendance event **********************/ /********************** 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", DB_QueryUPDATE ("can not hide/unhide assignment",
"UPDATE att_events" "UPDATE att_events"
@ -400,7 +400,7 @@ void Att_DB_RemoveGroupsOfType (long GrpTypCod)
/****************** Remove groups of an attendance event *********************/ /****************** 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" DB_QueryDELETE ("can not remove the groups"
" associated to an attendance event", " 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 *********/ /******* 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) return (unsigned)
DB_QueryCOUNT ("can not get number of students registered in an event", 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 ***********/ /********** 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) return (unsigned)
DB_QueryCOUNT ("can not get number of students from a list" 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 *************/ /*********** Return a list with the users in an attendance event *************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Att_DB_GetListUsrsInAttEvent (MYSQL_RES **mysql_res, unsigned Att_DB_GetListUsrsInEvent (MYSQL_RES **mysql_res,
long AttCod,bool AttEventIsAsociatedToGrps) long AttCod,bool AttEventIsAsociatedToGrps)
{ {
char *SubQuery; char *SubQuery;
unsigned NumUsrs; unsigned NumUsrs;
@ -576,10 +576,10 @@ unsigned Att_DB_GetListUsrsInAttEvent (MYSQL_RES **mysql_res,
/********* Register a user in an attendance event changing comments **********/ /********* Register a user in an attendance event changing comments **********/
/*****************************************************************************/ /*****************************************************************************/
void Att_DB_RegUsrInAttEventChangingComments (long AttCod,long UsrCod, void Att_DB_RegUsrInEventChangingComments (long AttCod,long UsrCod,
bool Present, bool Present,
const char *CommentStd, const char *CommentStd,
const char *CommentTch) const char *CommentTch)
{ {
/***** Register user as assistant to an event in database *****/ /***** Register user as assistant to an event in database *****/
DB_QueryREPLACE ("can not register user in an event", 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); Att_DB_SetUsrAsPresent (AttCod,UsrDat.UsrCod);
} }
else // User is not in table att_users 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 */ /* Add this user to query used to mark not present users as absent */
if (SetOthersAsAbsent) if (SetOthersAsAbsent)
@ -713,7 +713,7 @@ void Att_DB_SetUsrsAsPresent (long AttCod,const char *ListUsrs,bool SetOthersAsA
/********************** Remove a user from an event **************************/ /********************** 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", DB_QueryDELETE ("can not remove student from an event",
"DELETE FROM att_users" "DELETE FROM att_users"
@ -726,7 +726,7 @@ void Att_DB_RemoveUsrFromAttEvent (long AttCod,long UsrCod)
/************ Remove users absent without comments from an event *************/ /************ Remove users absent without comments from an event *************/
/*****************************************************************************/ /*****************************************************************************/
void Att_DB_RemoveUsrsAbsentWithoutCommentsFromAttEvent (long AttCod) void Att_DB_RemoveUsrsAbsentWithoutCommentsFromEvent (long AttCod)
{ {
/***** Clean table att_users *****/ /***** Clean table att_users *****/
DB_QueryDELETE ("can not remove users absent" 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 **************/ /*********** 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", DB_QueryDELETE ("can not remove attendance event",
"DELETE FROM att_users" "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 ***/ /*** 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", DB_QueryDELETE ("can not remove user from all attendance events",
"DELETE FROM att_users" "DELETE FROM att_users"
@ -767,7 +767,7 @@ void Att_DB_RemoveUsrFromAllAttEvents (long UsrCod)
/************* Remove one student from all attendance events *****************/ /************* 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", DB_QueryDELETE ("can not remove user from attendance events of a course",
"DELETE FROM att_users" "DELETE FROM att_users"
@ -783,7 +783,7 @@ void Att_DB_RemoveUsrFromCrsAttEvents (long UsrCod,long CrsCod)
/*********************** Remove an attendance event **************************/ /*********************** Remove an attendance event **************************/
/*****************************************************************************/ /*****************************************************************************/
void Att_DB_RemoveAttEventFromCurrentCrs (long AttCod) void Att_DB_RemoveEventFromCurrentCrs (long AttCod)
{ {
DB_QueryDELETE ("can not remove attendance event", DB_QueryDELETE ("can not remove attendance event",
"DELETE FROM att_events" "DELETE FROM att_events"
@ -795,7 +795,7 @@ void Att_DB_RemoveAttEventFromCurrentCrs (long AttCod)
/************* Remove users in all attendance events of a course *************/ /************* 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" DB_QueryDELETE ("can not remove users registered"
" in attendance events of a course", " 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 *************/ /************ 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" DB_QueryDELETE ("can not remove all groups associated"
" to attendance events of a course", " to attendance events of a course",
@ -827,7 +827,7 @@ void Att_DB_RemoveGrpsAssociatedToCrsAttEvents (long CrsCod)
/***************** Remove all attendance events of a course ******************/ /***************** 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", DB_QueryDELETE ("can not remove all attendance events of a course",
"DELETE FROM att_events" "DELETE FROM att_events"
@ -839,7 +839,7 @@ void Att_DB_RemoveCrsAttEvents (long CrsCod)
/*************** Get number of attendance events in a course *****************/ /*************** 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 *****/ /***** Get number of attendance events in a course from database *****/
return (unsigned) return (unsigned)
@ -856,7 +856,7 @@ unsigned Att_DB_GetNumAttEventsInCrs (long CrsCod)
// Returns the number of courses with attendance events // Returns the number of courses with attendance events
// in this location (all the platform, the current degree or the current course) // 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) switch (Scope)
{ {
@ -911,7 +911,7 @@ unsigned Att_DB_GetNumCoursesWithAttEvents (HieLvl_Level_t Scope)
/********************* Get number of attendance events ***********************/ /********************* 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) switch (Scope)
{ {

View File

@ -37,58 +37,58 @@
/***************************** Public prototypes *****************************/ /***************************** Public prototypes *****************************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Att_DB_GetListAttEventsMyGrps (MYSQL_RES **mysql_res, unsigned Att_DB_GetListEventsMyGrps (MYSQL_RES **mysql_res,
Dat_StartEndTime_t SelectedOrder, Dat_StartEndTime_t SelectedOrder,
Att_OrderNewestOldest_t OrderNewestOldest); Att_OrderNewestOldest_t OrderNewestOldest);
unsigned Att_DB_GetListAttEventsAllGrps (MYSQL_RES **mysql_res, unsigned Att_DB_GetListEventsAllGrps (MYSQL_RES **mysql_res,
Dat_StartEndTime_t SelectedOrder, Dat_StartEndTime_t SelectedOrder,
Att_OrderNewestOldest_t OrderNewestOldest); Att_OrderNewestOldest_t OrderNewestOldest);
unsigned Att_DB_GetDataOfAllAttEvents (MYSQL_RES **mysql_res,long CrsCod); unsigned Att_DB_GetAllEventsData (MYSQL_RES **mysql_res,long CrsCod);
unsigned Att_DB_GetDataOfAttEventByCod (MYSQL_RES **mysql_res,long AttCod); unsigned Att_DB_GetEventDataByCod (MYSQL_RES **mysql_res,long AttCod);
void Att_DB_GetAttEventTitle (long AttCod, void Att_DB_GetEventTitle (long AttCod,
char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1]); char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1]);
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]);
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); long Att_DB_CreateEvent (const struct Att_Event *Event,const char *Description);
void Att_DB_UpdateAttEvent (const struct Att_Event *Event,const char *Description); void Att_DB_UpdateEvent (const struct Att_Event *Event,const char *Description);
void Att_DB_HideOrUnhideAttEvent (long AttCod,bool Hide); void Att_DB_HideOrUnhideEvent (long AttCod,bool Hide);
void Att_DB_CreateGroup (long AttCod,long GrpCod); void Att_DB_CreateGroup (long AttCod,long GrpCod);
unsigned Att_DB_GetGrpCodsAssociatedToEvent (MYSQL_RES **mysql_res,long AttCod); unsigned Att_DB_GetGrpCodsAssociatedToEvent (MYSQL_RES **mysql_res,long AttCod);
unsigned Att_DB_GetGroupsAssociatedToEvent (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_RemoveGroup (long GrpCod);
void Att_DB_RemoveGroupsOfType (long GrpTypCod); 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_GetNumStdsTotalWhoAreInEvent (long AttCod);
unsigned Att_DB_GetNumStdsFromListWhoAreInAttEvent (long AttCod,const char *SubQueryUsrs); unsigned Att_DB_GetNumStdsFromListWhoAreInEvent (long AttCod,const char *SubQueryUsrs);
bool Att_DB_CheckIfUsrIsInTableAttUsr (long AttCod,long UsrCod,bool *Present); 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_GetPresentAndComments (MYSQL_RES **mysql_res,long AttCod,long UsrCod);
unsigned Att_DB_GetListUsrsInAttEvent (MYSQL_RES **mysql_res, unsigned Att_DB_GetListUsrsInEvent (MYSQL_RES **mysql_res,
long AttCod,bool AttEventIsAsociatedToGrps); long AttCod,bool AttEventIsAsociatedToGrps);
void Att_DB_RegUsrInAttEventChangingComments (long AttCod,long UsrCod, void Att_DB_RegUsrInEventChangingComments (long AttCod,long UsrCod,
bool Present, bool Present,
const char *CommentStd, const char *CommentStd,
const char *CommentTch); const char *CommentTch);
void Att_DB_SetUsrAsPresent (long AttCod,long UsrCod); void Att_DB_SetUsrAsPresent (long AttCod,long UsrCod);
void Att_DB_SetUsrsAsPresent (long AttCod,const char *ListUsrs,bool SetOthersAsAbsent); void Att_DB_SetUsrsAsPresent (long AttCod,const char *ListUsrs,bool SetOthersAsAbsent);
void Att_DB_RemoveUsrFromAttEvent (long AttCod,long UsrCod); void Att_DB_RemoveUsrFromEvent (long AttCod,long UsrCod);
void Att_DB_RemoveUsrsAbsentWithoutCommentsFromAttEvent (long AttCod); void Att_DB_RemoveUsrsAbsentWithoutCommentsFromEvent (long AttCod);
void Att_DB_RemoveAllUsrsFromAnAttEvent (long AttCod); void Att_DB_RemoveAllUsrsFromAnEvent (long AttCod);
void Att_DB_RemoveUsrFromAllAttEvents (long UsrCod); void Att_DB_RemoveUsrFromAllEvents (long UsrCod);
void Att_DB_RemoveUsrFromCrsAttEvents (long UsrCod,long CrsCod); void Att_DB_RemoveUsrFromCrsEvents (long UsrCod,long CrsCod);
void Att_DB_RemoveAttEventFromCurrentCrs (long AttCod); void Att_DB_RemoveEventFromCurrentCrs (long AttCod);
void Att_DB_RemoveUsrsFromCrsAttEvents (long CrsCod); void Att_DB_RemoveUsrsFromCrsEvents (long CrsCod);
void Att_DB_RemoveGrpsAssociatedToCrsAttEvents (long CrsCod); void Att_DB_RemoveGrpsAssociatedToCrsEvents (long CrsCod);
void Att_DB_RemoveCrsAttEvents (long CrsCod); void Att_DB_RemoveCrsEvents (long CrsCod);
unsigned Att_DB_GetNumAttEventsInCrs (long CrsCod); unsigned Att_DB_GetNumEventsInCrs (long CrsCod);
unsigned Att_DB_GetNumCoursesWithAttEvents (HieLvl_Level_t Scope); 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 #endif

View File

@ -58,15 +58,15 @@ void AttRsc_GetLinkToEvent (void)
Title); Title);
/***** Show attendance events again *****/ /***** Show attendance events again *****/
Att_SeeAttEvents (); Att_SeeEvents ();
} }
/*****************************************************************************/ /*****************************************************************************/
/**************** Write attendance event in course program *******************/ /**************** Write attendance event in course program *******************/
/*****************************************************************************/ /*****************************************************************************/
void AttRsc_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo, void AttRsc_WriteEventInCrsProgram (long AttCod,bool PutFormToGo,
const char *Icon,const char *IconTitle) const char *Icon,const char *IconTitle)
{ {
extern const char *Txt_Actions[ActLst_NUM_ACTIONS]; extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
Act_Action_t NextAction; Act_Action_t NextAction;
@ -120,7 +120,7 @@ void AttRsc_GetTitleFromAttCod (long AttCod,char *Title,size_t TitleSize)
if (AttCod > 0) if (AttCod > 0)
{ {
/***** Get attendance event title *****/ /***** Get attendance event title *****/
Att_DB_GetAttEventTitle (AttCod,TitleFromDB); Att_DB_GetEventTitle (AttCod,TitleFromDB);
Str_Copy (Title,TitleFromDB,TitleSize); Str_Copy (Title,TitleFromDB,TitleSize);
} }
else else

View File

@ -34,8 +34,8 @@
/*****************************************************************************/ /*****************************************************************************/
void AttRsc_GetLinkToEvent (void); void AttRsc_GetLinkToEvent (void);
void AttRsc_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo, void AttRsc_WriteEventInCrsProgram (long AttCod,bool PutFormToGo,
const char *Icon,const char *IconTitle); const char *Icon,const char *IconTitle);
void AttRsc_GetTitleFromAttCod (long AttCod,char *Title,size_t TitleSize); void AttRsc_GetTitleFromAttCod (long AttCod,char *Title,size_t TitleSize);
#endif #endif

View File

@ -297,7 +297,7 @@ static void Ban_GetListBanners (struct Ban_Banners *Banners,
/************************* Get banner data by code ***************************/ /************************* Get banner data by code ***************************/
/*****************************************************************************/ /*****************************************************************************/
void Ban_GetDataOfBannerByCod (struct Ban_Banner *Ban) void Ban_GetBannerDataByCod (struct Ban_Banner *Ban)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
@ -309,7 +309,7 @@ void Ban_GetDataOfBannerByCod (struct Ban_Banner *Ban)
if (Ban->BanCod > 0) if (Ban->BanCod > 0)
{ {
/***** Get data of a banner from database *****/ /***** 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); Ban_GetBannerDataFromRow (mysql_res,Ban);
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
@ -523,7 +523,7 @@ void Ban_RemoveBanner (void)
Ban->BanCod = ParCod_GetAndCheckPar (ParCod_Ban); Ban->BanCod = ParCod_GetAndCheckPar (ParCod_Ban);
/***** Get data of the banner from database *****/ /***** Get data of the banner from database *****/
Ban_GetDataOfBannerByCod (Ban); Ban_GetBannerDataByCod (Ban);
/***** Remove banner *****/ /***** Remove banner *****/
Ban_DB_RemoveBanner (Ban->BanCod); 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); Ban->BanCod = ParCod_GetAndCheckPar (ParCod_Ban);
/***** Get data of the banner from database *****/ /***** Get data of the banner from database *****/
Ban_GetDataOfBannerByCod (Ban); Ban_GetBannerDataByCod (Ban);
/***** Mark file as hidden/visible in database *****/ /***** Mark file as hidden/visible in database *****/
if (Ban->Hidden != Hide) if (Ban->Hidden != Hide)
@ -651,7 +651,7 @@ static void Ban_RenameBanner (struct Ban_Banner *Ban,
Par_GetParText (ParName,NewBanName,MaxBytes); Par_GetParText (ParName,NewBanName,MaxBytes);
/***** Get banner data from the database *****/ /***** Get banner data from the database *****/
Ban_GetDataOfBannerByCod (Ban); Ban_GetBannerDataByCod (Ban);
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewBanName[0]) if (!NewBanName[0])
@ -709,7 +709,7 @@ void Ban_ChangeBannerImg (void)
Par_GetParText ("Img",NewImg,Ban_MAX_BYTES_IMAGE); Par_GetParText ("Img",NewImg,Ban_MAX_BYTES_IMAGE);
/***** Get banner data from the database *****/ /***** Get banner data from the database *****/
Ban_GetDataOfBannerByCod (Ban); Ban_GetBannerDataByCod (Ban);
/***** Check if new image is empty *****/ /***** Check if new image is empty *****/
if (NewImg[0]) if (NewImg[0])
@ -751,7 +751,7 @@ void Ban_ChangeBannerWWW (void)
Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
/***** Get banner data from the database *****/ /***** Get banner data from the database *****/
Ban_GetDataOfBannerByCod (Ban); Ban_GetBannerDataByCod (Ban);
/***** Check if new WWW is empty *****/ /***** Check if new WWW is empty *****/
if (NewWWW[0]) if (NewWWW[0])
@ -1008,7 +1008,7 @@ void Ban_ClickOnBanner (void)
Ban.BanCod = ParCod_GetAndCheckPar (ParCod_Ban); Ban.BanCod = ParCod_GetAndCheckPar (ParCod_Ban);
/***** Get data of the banner from database *****/ /***** Get data of the banner from database *****/
Ban_GetDataOfBannerByCod (&Ban); Ban_GetBannerDataByCod (&Ban);
/***** Set banner clicked in order to log it *****/ /***** Set banner clicked in order to log it *****/
Ban_SetBanCodClicked (Ban.BanCod); Ban_SetBanCodClicked (Ban.BanCod);

View File

@ -61,7 +61,7 @@ void Ban_EditBanners (void);
void Ban_PutIconToViewBanners (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_RemoveBanner (void);
void Ban_ShowBanner (void); void Ban_ShowBanner (void);
void Ban_HideBanner (void); void Ban_HideBanner (void);

View File

@ -102,7 +102,7 @@ unsigned Ban_DB_GetRandomBanners (MYSQL_RES **mysql_res)
/********************* Get data of a banner from database ********************/ /********************* 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of a banner", DB_QuerySELECT (mysql_res,"can not get data of a banner",

View File

@ -38,7 +38,7 @@
unsigned Ban_DB_GetAllBanners (MYSQL_RES **mysql_res); unsigned Ban_DB_GetAllBanners (MYSQL_RES **mysql_res);
unsigned Ban_DB_GetVisibleBanners (MYSQL_RES **mysql_res); unsigned Ban_DB_GetVisibleBanners (MYSQL_RES **mysql_res);
unsigned Ban_DB_GetRandomBanners (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); bool Ban_DB_CheckIfBannerNameExists (const char *FldName,const char *Name,long BanCod);
void Ban_DB_CreateBanner (const struct Ban_Banner *Ban); void Ban_DB_CreateBanner (const struct Ban_Banner *Ban);

View File

@ -2017,7 +2017,7 @@ static void Brw_GetDataCurrentGrp (void)
if (Gbl.Crs.Grps.GrpCod > 0) if (Gbl.Crs.Grps.GrpCod > 0)
{ {
GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
switch (Gbl.Action.Act) 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] = *Ptr; // Copy assignment folder
Gbl.FileBrowser.Asg.Folder[i] = '\0'; 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 */ /* Get next group */
GrpDat.GrpCod = LstMyGrps.GrpCods[NumGrp]; GrpDat.GrpCod = LstMyGrps.GrpCods[NumGrp];
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
/* Select this group */ /* Select this group */
HTM_LI_Begin ("class=\"%s\"", HTM_LI_Begin ("class=\"%s\"",
@ -2911,7 +2911,7 @@ static void Brw_GetSelectedGroupData (struct GroupData *GrpDat,bool AbortOnError
if (GrpDat->GrpCod > 0) if (GrpDat->GrpCod > 0)
{ {
/***** Get the data of the selected group *****/ /***** Get the data of the selected group *****/
Grp_GetDataOfGroupByCod (GrpDat); Grp_GetGroupDataByCod (GrpDat);
/***** For security, check if group file zones are enabled, /***** For security, check if group file zones are enabled,
and check if I belongs to the selected group *****/ 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, Str_Copy (Gbl.FileBrowser.Asg.Folder,Gbl.FileBrowser.FilFolLnk.Name,
sizeof (Gbl.FileBrowser.Asg.Folder) - 1); 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 // The data of this assignment remains in Gbl.FileBrowser.Asg
// for all subsequent rows with Level > 1 (files or folders inside this folder), // 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) // 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: case Brw_ADMI_DOC_INS:
Hie.Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod;
Ins_GetDataOfInstitByCod (&Hie.Ins); Ins_GetInstitDataByCod (&Hie.Ins);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>",
Txt_documents_management_area, Txt_documents_management_area,
@ -5397,7 +5397,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_SHR_INS: case Brw_ADMI_SHR_INS:
Hie.Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod;
Ins_GetDataOfInstitByCod (&Hie.Ins); Ins_GetInstitDataByCod (&Hie.Ins);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>",
Txt_shared_files_area, Txt_shared_files_area,
@ -5405,7 +5405,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_DOC_CTR: case Brw_ADMI_DOC_CTR:
Hie.Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
Ctr_GetDataOfCenterByCod (&Hie.Ctr); Ctr_GetCenterDataByCod (&Hie.Ctr);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>",
Txt_documents_management_area, Txt_documents_management_area,
@ -5413,7 +5413,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_SHR_CTR: case Brw_ADMI_SHR_CTR:
Hie.Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
Ctr_GetDataOfCenterByCod (&Hie.Ctr); Ctr_GetCenterDataByCod (&Hie.Ctr);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>",
Txt_shared_files_area, Txt_shared_files_area,
@ -5421,7 +5421,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_DOC_DEG: case Brw_ADMI_DOC_DEG:
Hie.Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
Deg_GetDataOfDegreeByCod (&Hie.Deg); Deg_GetDegreeDataByCod (&Hie.Deg);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>",
Txt_documents_management_area, Txt_documents_management_area,
@ -5429,7 +5429,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_SHR_DEG: case Brw_ADMI_SHR_DEG:
Hie.Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
Deg_GetDataOfDegreeByCod (&Hie.Deg); Deg_GetDegreeDataByCod (&Hie.Deg);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>",
Txt_shared_files_area, Txt_shared_files_area,
@ -5437,7 +5437,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_DOC_CRS: case Brw_ADMI_DOC_CRS:
Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>",
Txt_documents_management_area, Txt_documents_management_area,
@ -5445,9 +5445,9 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_DOC_GRP: case Brw_ADMI_DOC_GRP:
GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
Hie.Crs.CrsCod = GrpDat.CrsCod; Hie.Crs.CrsCod = GrpDat.CrsCod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>", "%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>",
Txt_documents_management_area, Txt_documents_management_area,
@ -5456,7 +5456,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_TCH_CRS: case Brw_ADMI_TCH_CRS:
Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>",
Txt_teachers_files_area, Txt_teachers_files_area,
@ -5464,9 +5464,9 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_TCH_GRP: case Brw_ADMI_TCH_GRP:
GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
Hie.Crs.CrsCod = GrpDat.CrsCod; Hie.Crs.CrsCod = GrpDat.CrsCod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>", "%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>",
Txt_teachers_files_area, Txt_teachers_files_area,
@ -5475,7 +5475,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_SHR_CRS: case Brw_ADMI_SHR_CRS:
Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>",
Txt_shared_files_area, Txt_shared_files_area,
@ -5483,9 +5483,9 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_SHR_GRP: case Brw_ADMI_SHR_GRP:
GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
Hie.Crs.CrsCod = GrpDat.CrsCod; Hie.Crs.CrsCod = GrpDat.CrsCod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>", "%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>",
Txt_shared_files_area, Txt_shared_files_area,
@ -5494,7 +5494,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_ASG_USR: case Brw_ADMI_ASG_USR:
Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>, %s <strong>%s</strong>",
Txt_assignments_area, Txt_assignments_area,
@ -5503,7 +5503,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_WRK_USR: case Brw_ADMI_WRK_USR:
Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>, %s <strong>%s</strong>",
Txt_works_area, Txt_works_area,
@ -5512,7 +5512,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_ASG_CRS: case Brw_ADMI_ASG_CRS:
Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
Usr_UsrDataConstructor (&UsrDat); Usr_UsrDataConstructor (&UsrDat);
UsrDat.UsrCod = Gbl.FileBrowser.Clipboard.WorksUsrCod; UsrDat.UsrCod = Gbl.FileBrowser.Clipboard.WorksUsrCod;
Usr_GetAllUsrDataFromUsrCod (&UsrDat, Usr_GetAllUsrDataFromUsrCod (&UsrDat,
@ -5527,7 +5527,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_WRK_CRS: case Brw_ADMI_WRK_CRS:
Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
Usr_UsrDataConstructor (&UsrDat); Usr_UsrDataConstructor (&UsrDat);
UsrDat.UsrCod = Gbl.FileBrowser.Clipboard.WorksUsrCod; UsrDat.UsrCod = Gbl.FileBrowser.Clipboard.WorksUsrCod;
Usr_GetAllUsrDataFromUsrCod (&UsrDat, Usr_GetAllUsrDataFromUsrCod (&UsrDat,
@ -5544,9 +5544,9 @@ static void Brw_WriteCurrentClipboard (void)
case Brw_ADMI_ASS_PRJ: case Brw_ADMI_ASS_PRJ:
Prj_AllocMemProject (&Prj); Prj_AllocMemProject (&Prj);
Prj.PrjCod = Gbl.FileBrowser.Clipboard.Cod; Prj.PrjCod = Gbl.FileBrowser.Clipboard.Cod;
Prj_GetDataOfProjectByCod (&Prj); Prj_GetProjectDataByCod (&Prj);
Hie.Crs.CrsCod = Prj.CrsCod; Hie.Crs.CrsCod = Prj.CrsCod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>, %s <strong>%s</strong>",
Gbl.FileBrowser.Clipboard.FileBrowser == Brw_ADMI_DOC_PRJ ? Txt_project_documents : Gbl.FileBrowser.Clipboard.FileBrowser == Brw_ADMI_DOC_PRJ ? Txt_project_documents :
@ -5557,7 +5557,7 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_MRK_CRS: case Brw_ADMI_MRK_CRS:
Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>",
Txt_marks_management_area, Txt_marks_management_area,
@ -5565,9 +5565,9 @@ static void Brw_WriteCurrentClipboard (void)
break; break;
case Brw_ADMI_MRK_GRP: case Brw_ADMI_MRK_GRP:
GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
Hie.Crs.CrsCod = GrpDat.CrsCod; Hie.Crs.CrsCod = GrpDat.CrsCod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>", "%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>",
Txt_marks_management_area, Txt_marks_management_area,
@ -5946,7 +5946,7 @@ static void Brw_PasteClipboard (struct BrwSiz_BrowserSize *Size)
case Brw_ADMI_DOC_INS: case Brw_ADMI_DOC_INS:
case Brw_ADMI_SHR_INS: case Brw_ADMI_SHR_INS:
Hie.Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod; 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", snprintf (PathOrg,sizeof (PathOrg),"%s/%02u/%u/%s",
Cfg_PATH_INS_PRIVATE, Cfg_PATH_INS_PRIVATE,
(unsigned) (Hie.Ins.InsCod % 100), (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_DOC_CTR:
case Brw_ADMI_SHR_CTR: case Brw_ADMI_SHR_CTR:
Hie.Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod; 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", snprintf (PathOrg,sizeof (PathOrg),"%s/%02u/%u/%s",
Cfg_PATH_CTR_PRIVATE, Cfg_PATH_CTR_PRIVATE,
(unsigned) (Hie.Ctr.CtrCod % 100), (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_DOC_DEG:
case Brw_ADMI_SHR_DEG: case Brw_ADMI_SHR_DEG:
Hie.Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod; 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", snprintf (PathOrg,sizeof (PathOrg),"%s/%02u/%u/%s",
Cfg_PATH_DEG_PRIVATE, Cfg_PATH_DEG_PRIVATE,
(unsigned) (Hie.Deg.DegCod % 100), (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_SHR_CRS:
case Brw_ADMI_MRK_CRS: case Brw_ADMI_MRK_CRS:
Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
if (Crs_GetDataOfCourseByCod (&Hie.Crs)) if (Crs_GetCourseDataByCod (&Hie.Crs))
snprintf (PathOrg,sizeof (PathOrg),"%s/%ld/%s", snprintf (PathOrg,sizeof (PathOrg),"%s/%ld/%s",
Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod, Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod,
Gbl.FileBrowser.Clipboard.FilFolLnk.Full); 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_SHR_GRP:
case Brw_ADMI_MRK_GRP: case Brw_ADMI_MRK_GRP:
GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
Hie.Crs.CrsCod = GrpDat.CrsCod; Hie.Crs.CrsCod = GrpDat.CrsCod;
if (Crs_GetDataOfCourseByCod (&Hie.Crs)) if (Crs_GetCourseDataByCod (&Hie.Crs))
snprintf (PathOrg,sizeof (PathOrg),"%s/%ld/%s/%ld/%s", snprintf (PathOrg,sizeof (PathOrg),"%s/%ld/%s/%ld/%s",
Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod,Cfg_FOLDER_GRP, Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod,Cfg_FOLDER_GRP,
GrpDat.GrpCod, GrpDat.GrpCod,
@ -6009,7 +6009,7 @@ static void Brw_PasteClipboard (struct BrwSiz_BrowserSize *Size)
case Brw_ADMI_ASG_CRS: case Brw_ADMI_ASG_CRS:
case Brw_ADMI_WRK_CRS: case Brw_ADMI_WRK_CRS:
Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
if (Crs_GetDataOfCourseByCod (&Hie.Crs)) if (Crs_GetCourseDataByCod (&Hie.Crs))
{ {
Usr_UsrDataConstructor (&UsrDat); Usr_UsrDataConstructor (&UsrDat);
if (Usr_DB_ChkIfUsrCodExists (Gbl.FileBrowser.Clipboard.WorksUsrCod)) 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_ASG_USR:
case Brw_ADMI_WRK_USR: case Brw_ADMI_WRK_USR:
Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; 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", snprintf (PathOrg,sizeof (PathOrg),"%s/%ld/%s/%02u/%ld/%s",
Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod,Cfg_FOLDER_USR, Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod,Cfg_FOLDER_USR,
(unsigned) (Gbl.Usrs.Me.UsrDat.UsrCod % 100), (unsigned) (Gbl.Usrs.Me.UsrDat.UsrCod % 100),
@ -6044,7 +6044,7 @@ static void Brw_PasteClipboard (struct BrwSiz_BrowserSize *Size)
case Brw_ADMI_ASS_PRJ: case Brw_ADMI_ASS_PRJ:
PrjCod = Gbl.FileBrowser.Clipboard.Cod; PrjCod = Gbl.FileBrowser.Clipboard.Cod;
Hie.Crs.CrsCod = Prj_DB_GetCrsOfPrj (PrjCod); 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", snprintf (PathOrg,sizeof (PathOrg),"%s/%ld/%s/%02u/%ld/%s",
Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod,Cfg_FOLDER_PRJ, Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod,Cfg_FOLDER_PRJ,
(unsigned) (PrjCod % 100), (unsigned) (PrjCod % 100),
@ -8788,7 +8788,7 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
*CrsCod = -1L; *CrsCod = -1L;
*DegCod = -1L; *DegCod = -1L;
*CtrCod = Ctr.CtrCod = Cod; *CtrCod = Ctr.CtrCod = Cod;
Ctr_GetDataOfCenterByCod (&Ctr); Ctr_GetCenterDataByCod (&Ctr);
*InsCod = Ctr.InsCod; *InsCod = Ctr.InsCod;
break; break;
case Brw_ADMI_DOC_DEG: case Brw_ADMI_DOC_DEG:
@ -8797,9 +8797,9 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
*GrpCod = -1L; *GrpCod = -1L;
*CrsCod = -1L; *CrsCod = -1L;
*DegCod = Deg.DegCod = Cod; *DegCod = Deg.DegCod = Cod;
Deg_GetDataOfDegreeByCod (&Deg); Deg_GetDegreeDataByCod (&Deg);
*CtrCod = Ctr.CtrCod = Deg.CtrCod; *CtrCod = Ctr.CtrCod = Deg.CtrCod;
Ctr_GetDataOfCenterByCod (&Ctr); Ctr_GetCenterDataByCod (&Ctr);
*InsCod = Ctr.InsCod; *InsCod = Ctr.InsCod;
break; break;
case Brw_ADMI_DOC_CRS: case Brw_ADMI_DOC_CRS:
@ -8811,11 +8811,11 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
/* Cod stores the course code */ /* Cod stores the course code */
*GrpCod = -1L; *GrpCod = -1L;
*CrsCod = Crs.CrsCod = Cod; *CrsCod = Crs.CrsCod = Cod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetCourseDataByCod (&Crs);
*DegCod = Deg.DegCod = Crs.DegCod; *DegCod = Deg.DegCod = Crs.DegCod;
Deg_GetDataOfDegreeByCod (&Deg); Deg_GetDegreeDataByCod (&Deg);
*CtrCod = Ctr.CtrCod = Deg.CtrCod; *CtrCod = Ctr.CtrCod = Deg.CtrCod;
Ctr_GetDataOfCenterByCod (&Ctr); Ctr_GetCenterDataByCod (&Ctr);
*InsCod = Ctr.InsCod; *InsCod = Ctr.InsCod;
break; break;
case Brw_ADMI_DOC_GRP: case Brw_ADMI_DOC_GRP:
@ -8824,13 +8824,13 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
case Brw_ADMI_MRK_GRP: case Brw_ADMI_MRK_GRP:
/* Cod stores the group code */ /* Cod stores the group code */
*GrpCod = GrpDat.GrpCod = Cod; *GrpCod = GrpDat.GrpCod = Cod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
*CrsCod = Crs.CrsCod = GrpDat.CrsCod; *CrsCod = Crs.CrsCod = GrpDat.CrsCod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetCourseDataByCod (&Crs);
*DegCod = Deg.DegCod = Crs.DegCod; *DegCod = Deg.DegCod = Crs.DegCod;
Deg_GetDataOfDegreeByCod (&Deg); Deg_GetDegreeDataByCod (&Deg);
*CtrCod = Ctr.CtrCod = Deg.CtrCod; *CtrCod = Ctr.CtrCod = Deg.CtrCod;
Ctr_GetDataOfCenterByCod (&Ctr); Ctr_GetCenterDataByCod (&Ctr);
*InsCod = Ctr.InsCod; *InsCod = Ctr.InsCod;
break; break;
case Brw_ADMI_DOC_PRJ: case Brw_ADMI_DOC_PRJ:
@ -8838,11 +8838,11 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
/* Cod stores the project code */ /* Cod stores the project code */
*GrpCod = -1L; *GrpCod = -1L;
*CrsCod = Crs.CrsCod = Prj_DB_GetCrsOfPrj (Cod); *CrsCod = Crs.CrsCod = Prj_DB_GetCrsOfPrj (Cod);
Crs_GetDataOfCourseByCod (&Crs); Crs_GetCourseDataByCod (&Crs);
*DegCod = Deg.DegCod = Crs.DegCod; *DegCod = Deg.DegCod = Crs.DegCod;
Deg_GetDataOfDegreeByCod (&Deg); Deg_GetDegreeDataByCod (&Deg);
*CtrCod = Ctr.CtrCod = Deg.CtrCod; *CtrCod = Ctr.CtrCod = Deg.CtrCod;
Ctr_GetDataOfCenterByCod (&Ctr); Ctr_GetCenterDataByCod (&Ctr);
*InsCod = Ctr.InsCod; *InsCod = Ctr.InsCod;
break; break;
default: default:
@ -9281,7 +9281,7 @@ void Brw_RemoveUsrWorksInAllCrss (struct Usr_Data *UsrDat)
Crs.CrsCod = Str_ConvertStrCodToLongCod (row[0]); Crs.CrsCod = Str_ConvertStrCodToLongCod (row[0]);
/* Get data of course */ /* Get data of course */
Crs_GetDataOfCourseByCod (&Crs); Crs_GetCourseDataByCod (&Crs);
Brw_RemoveUsrWorksInCrs (UsrDat,&Crs); Brw_RemoveUsrWorksInCrs (UsrDat,&Crs);
NumCrssWorksRemoved++; NumCrssWorksRemoved++;
} }

View File

@ -67,6 +67,10 @@ static void Bld_PutIconsEditingBuildings (__attribute__((unused)) void *Args);
static void Bld_EditBuildingsInternal (void); 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_ListBuildingsForEdition (const struct Bld_Buildings *Buildings);
static void Bld_PutParBldCod (void *BldCod); 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, void Bld_GetListBuildings (struct Bld_Buildings *Buildings,
Bld_WhichData_t WhichData) Bld_WhichData_t WhichData)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned NumBuilding; unsigned NumBuilding;
struct Bld_Building *Building;
/***** Get buildings from database *****/ /***** 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 *****/ /***** Count number of rows in result *****/
if (Buildings->Num) // Buildings found... if (Buildings->Num) // Buildings found...
{ {
/***** Create list with courses in center *****/ /***** Create list with buldings in center *****/
if ((Buildings->Lst = calloc ((size_t) Buildings->Num,sizeof (*Buildings->Lst))) == NULL) if ((Buildings->Lst = calloc ((size_t) Buildings->Num,
sizeof (*Buildings->Lst))) == NULL)
Err_NotEnoughMemoryExit (); Err_NotEnoughMemoryExit ();
/***** Get the buildings *****/ /***** Get the buildings *****/
for (NumBuilding = 0; for (NumBuilding = 0;
NumBuilding < Buildings->Num; NumBuilding < Buildings->Num;
NumBuilding++) NumBuilding++)
{ Bld_GetBuildingDataFromRow (mysql_res,&Buildings->Lst[NumBuilding],
Building = &Buildings->Lst[NumBuilding]; WhichData);
/* 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);
}
}
} }
/***** Free structure that stores the query result *****/ /***** 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_RES *mysql_res;
MYSQL_ROW row;
/***** Clear data *****/ /***** Clear data *****/
Building->ShrtName[0] = '\0'; Building->ShrtName[0] = '\0';
@ -370,23 +355,43 @@ void Bld_GetDataOfBuildingByCod (struct Bld_Building *Building)
if (Building->BldCod > 0) if (Building->BldCod > 0)
{ {
/***** Get data of a building from database *****/ /***** Get data of a building from database *****/
if (Bld_DB_GetDataOfBuildingByCod (&mysql_res,Building->BldCod)) // Building found... if (Bld_DB_GetBuildingDataByCod (&mysql_res,Building->BldCod)) // Building found...
{ Bld_GetBuildingDataFromRow (mysql_res,Building,Bld_ALL_DATA);
/* 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);
}
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res); 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 ***************************/ /************************** Free list of buildings ***************************/
/*****************************************************************************/ /*****************************************************************************/
@ -508,7 +513,7 @@ void Bld_RemoveBuilding (void)
Bld_EditingBuilding->BldCod = ParCod_GetAndCheckPar (ParCod_Bld); Bld_EditingBuilding->BldCod = ParCod_GetAndCheckPar (ParCod_Bld);
/***** Get data of the building from database *****/ /***** Get data of the building from database *****/
Bld_GetDataOfBuildingByCod (Bld_EditingBuilding); Bld_GetBuildingDataByCod (Bld_EditingBuilding);
/***** Update rooms assigned to this building *****/ /***** Update rooms assigned to this building *****/
Roo_DB_RemoveBuildingFromRooms (Bld_EditingBuilding->BldCod); Roo_DB_RemoveBuildingFromRooms (Bld_EditingBuilding->BldCod);
@ -587,7 +592,7 @@ static void Bld_RenameBuilding (Cns_ShrtOrFullName_t ShrtOrFullName)
Par_GetParText (ParName,NewClaName,MaxBytes); Par_GetParText (ParName,NewClaName,MaxBytes);
/***** Get from the database the old names of the building *****/ /***** Get from the database the old names of the building *****/
Bld_GetDataOfBuildingByCod (Bld_EditingBuilding); Bld_GetBuildingDataByCod (Bld_EditingBuilding);
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (NewClaName[0]) if (NewClaName[0])
@ -644,7 +649,7 @@ void Bld_ChangeBuildingLocation (void)
Par_GetParText ("Location",NewLocation,Bld_MAX_BYTES_LOCATION); Par_GetParText ("Location",NewLocation,Bld_MAX_BYTES_LOCATION);
/***** Get from the database the old location of the building *****/ /***** 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 /***** Check if old and new locations are the same
(this happens when return is pressed without changes) *****/ (this happens when return is pressed without changes) *****/

View File

@ -89,7 +89,7 @@ void Bld_FreeListBuildings (struct Bld_Buildings *Buildings);
void Bld_GetListBuildingsInThisCtr (void); void Bld_GetListBuildingsInThisCtr (void);
void Bld_GetDataOfBuildingByCod (struct Bld_Building *Roo); void Bld_GetBuildingDataByCod (struct Bld_Building *Roo);
void Bld_RemoveBuilding (void); void Bld_RemoveBuilding (void);
void Bld_RenameBuildingShort (void); void Bld_RenameBuildingShort (void);

View File

@ -99,13 +99,14 @@ unsigned Bld_DB_GetListBuildings (MYSQL_RES **mysql_res,
/**************** Get building data giving the building code *****************/ /**************** 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of a building", DB_QuerySELECT (mysql_res,"can not get data of a building",
"SELECT ShortName," // row[0] "SELECT BldCod," // row[0]
"FullName," // row[1] "ShortName," // row[1]
"Location" // row[2] "FullName," // row[2]
"Location" // row[3]
" FROM bld_buildings" " FROM bld_buildings"
" WHERE BldCod=%ld", " WHERE BldCod=%ld",
BldCod); BldCod);

View File

@ -40,7 +40,7 @@ void Bld_DB_CreateBuilding (const struct Bld_Building *Building);
unsigned Bld_DB_GetListBuildings (MYSQL_RES **mysql_res, unsigned Bld_DB_GetListBuildings (MYSQL_RES **mysql_res,
Bld_WhichData_t WhichData, Bld_WhichData_t WhichData,
Bld_Order_t SelectedOrder); 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); bool Bld_DB_CheckIfBuildingNameExists (const char *FldName,const char *Name,long BldCod);
void Bld_DB_UpdateBuildingName (long BldCod,const char *FldName,const char *NewBuildingName); void Bld_DB_UpdateBuildingName (long BldCod,const char *FldName,const char *NewBuildingName);

View File

@ -920,7 +920,7 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams,
/***** Get data of institution of this degree *****/ /***** Get data of institution of this degree *****/
Ins.InsCod = Gbl.Hierarchy.Ins.InsCod; Ins.InsCod = Gbl.Hierarchy.Ins.InsCod;
Ins_GetDataOfInstitByCod (&Ins); Ins_GetInstitDataByCod (&Ins);
/***** Build anchor string *****/ /***** Build anchor string *****/
Frm_SetAnchorStr (ExaCod,&Anchor); Frm_SetAnchorStr (ExaCod,&Anchor);
@ -1616,15 +1616,15 @@ static void Cfe_GetNotifContentCallForExam (const struct Cfe_CallsForExams *Call
/***** Get data of course *****/ /***** Get data of course *****/
Hie.Crs.CrsCod = CallsForExams->CallForExam.CrsCod; Hie.Crs.CrsCod = CallsForExams->CallForExam.CrsCod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
/***** Get data of degree *****/ /***** Get data of degree *****/
Hie.Deg.DegCod = Hie.Crs.DegCod; Hie.Deg.DegCod = Hie.Crs.DegCod;
Deg_GetDataOfDegreeByCod (&Hie.Deg); Deg_GetDegreeDataByCod (&Hie.Deg);
/***** Get data of institution *****/ /***** Get data of institution *****/
Hie.Ins.InsCod = Deg_DB_GetInsCodOfDegreeByCod (Hie.Deg.DegCod); Hie.Ins.InsCod = Deg_DB_GetInsCodOfDegreeByCod (Hie.Deg.DegCod);
Ins_GetDataOfInstitByCod (&Hie.Ins); Ins_GetInstitDataByCod (&Hie.Ins);
/***** Convert struct date to a date string *****/ /***** Convert struct date to a date string *****/
Dat_ConvDateToDateStr (&CallsForExams->CallForExam.ExamDate,StrExamDate); Dat_ConvDateToDateStr (&CallsForExams->CallForExam.ExamDate,StrExamDate);

View File

@ -155,7 +155,7 @@ void Ctr_SeeCtrWithPendingDegs (void)
The_GetColorRows (); The_GetColorRows ();
/* Get data of center */ /* Get data of center */
Ctr_GetDataOfCenterByCod (&Ctr); Ctr_GetCenterDataByCod (&Ctr);
/* Center logo and full name */ /* Center logo and full name */
HTM_TR_Begin (NULL); 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 *****/ /***** Get data of place of this center *****/
Plc.PlcCod = Ctr->PlcCod; Plc.PlcCod = Ctr->PlcCod;
Plc_GetDataOfPlaceByCod (&Plc); Plc_GetPlaceDataByCod (&Plc);
if (Ctr->Status & Hie_STATUS_BIT_PENDING) 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 *************************/ /************************ Get data of center by code *************************/
/*****************************************************************************/ /*****************************************************************************/
bool Ctr_GetDataOfCenterByCod (struct Ctr_Center *Ctr) bool Ctr_GetCenterDataByCod (struct Ctr_Center *Ctr)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
bool CtrFound = false; bool CtrFound = false;
@ -599,7 +599,7 @@ bool Ctr_GetDataOfCenterByCod (struct Ctr_Center *Ctr)
if (Ctr->CtrCod > 0) if (Ctr->CtrCod > 0)
{ {
/***** Get data of a center from database *****/ /***** 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 */ /* Get center data */
Ctr_GetCenterDataFromRow (mysql_res,Ctr, Ctr_GetCenterDataFromRow (mysql_res,Ctr,
@ -965,7 +965,7 @@ void Ctr_RemoveCenter (void)
Ctr_EditingCtr->CtrCod = ParCod_GetAndCheckPar (ParCod_OthHie); Ctr_EditingCtr->CtrCod = ParCod_GetAndCheckPar (ParCod_OthHie);
/***** Get data of the center from database *****/ /***** Get data of the center from database *****/
Ctr_GetDataOfCenterByCod (Ctr_EditingCtr); Ctr_GetCenterDataByCod (Ctr_EditingCtr);
/***** Check if this center has teachers *****/ /***** Check if this center has teachers *****/
if (Deg_GetNumDegsInCtr (Ctr_EditingCtr->CtrCod)) // Center has degrees 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 NewPlcCod = ParCod_GetAndCheckParMin (ParCod_Plc,0); // 0 (another place) is allowed here
/***** Get data of center from database *****/ /***** Get data of center from database *****/
Ctr_GetDataOfCenterByCod (Ctr_EditingCtr); Ctr_GetCenterDataByCod (Ctr_EditingCtr);
/***** Update place in table of centers *****/ /***** Update place in table of centers *****/
Ctr_DB_UpdateCtrPlc (Ctr_EditingCtr->CtrCod,NewPlcCod); 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); Par_GetParText (ParName,NewCtrName,MaxBytes);
/***** Get from the database the old names of the center *****/ /***** Get from the database the old names of the center *****/
Ctr_GetDataOfCenterByCod (Ctr); Ctr_GetCenterDataByCod (Ctr);
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewCtrName[0]) if (!NewCtrName[0])
@ -1167,7 +1167,7 @@ void Ctr_ChangeCtrWWW (void)
Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
/***** Get data of center *****/ /***** Get data of center *****/
Ctr_GetDataOfCenterByCod (Ctr_EditingCtr); Ctr_GetCenterDataByCod (Ctr_EditingCtr);
/***** Check if new WWW is empty *****/ /***** Check if new WWW is empty *****/
if (NewWWW[0]) if (NewWWW[0])
@ -1206,7 +1206,7 @@ void Ctr_ChangeCtrStatus (void)
Status = Hie_GetParStatus (); // New status Status = Hie_GetParStatus (); // New status
/***** Get data of center *****/ /***** Get data of center *****/
Ctr_GetDataOfCenterByCod (Ctr_EditingCtr); Ctr_GetCenterDataByCod (Ctr_EditingCtr);
/***** Update status *****/ /***** Update status *****/
Ctr_DB_UpdateCtrStatus (Ctr_EditingCtr->CtrCod,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); Ctr.CtrCod = DB_GetNextCode (*mysql_res);
/* Get data of center */ /* Get data of center */
Ctr_GetDataOfCenterByCod (&Ctr); Ctr_GetCenterDataByCod (&Ctr);
/* Write data of this center */ /* Write data of this center */
Ctr_ListOneCenterForSeeing (&Ctr,NumCtr); Ctr_ListOneCenterForSeeing (&Ctr,NumCtr);

View File

@ -90,7 +90,7 @@ void Ctr_PutIconToViewCenters (void);
void Ctr_GetBasicListOfCenters (long InsCod); void Ctr_GetBasicListOfCenters (long InsCod);
void Ctr_GetFullListOfCenters (long InsCod,Ctr_Order_t SelectedOrder); 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_FreeListCenters (void);
void Ctr_WriteSelectorOfCenter (void); void Ctr_WriteSelectorOfCenter (void);
void Ctr_RemoveCenter (void); void Ctr_RemoveCenter (void);

View File

@ -643,7 +643,7 @@ static void CtrCfg_Place (bool PutForm)
/***** Get data of place *****/ /***** Get data of place *****/
Plc.PlcCod = Gbl.Hierarchy.Ctr.PlcCod; Plc.PlcCod = Gbl.Hierarchy.Ctr.PlcCod;
Plc_GetDataOfPlaceByCod (&Plc); Plc_GetPlaceDataByCod (&Plc);
/***** Place *****/ /***** Place *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -1014,7 +1014,7 @@ void CtrCfg_ChangeCtrIns (void)
if (NewIns.InsCod != Gbl.Hierarchy.Ctr.InsCod) if (NewIns.InsCod != Gbl.Hierarchy.Ctr.InsCod)
{ {
/***** Get data of new institution *****/ /***** 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 *****/ /***** Check if it already exists a center with the same name in the new institution *****/
if (Ctr_DB_CheckIfCtrNameExistsInIns ("ShortName", if (Ctr_DB_CheckIfCtrNameExistsInIns ("ShortName",

View File

@ -214,7 +214,7 @@ unsigned Ctr_DB_GetCtrsWithPendingDegs (MYSQL_RES **mysql_res)
/************************ Get data of center by code *************************/ /************************ 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of a center", DB_QuerySELECT (mysql_res,"can not get data of a center",

View File

@ -45,7 +45,7 @@ unsigned Ctr_DB_GetListOfCtrsFull (MYSQL_RES **mysql_res,long InsCod);
unsigned Ctr_DB_GetListOfCtrsFullWithNumUsrs (MYSQL_RES **mysql_res, unsigned Ctr_DB_GetListOfCtrsFullWithNumUsrs (MYSQL_RES **mysql_res,
long InsCod,Ctr_Order_t SelectedOrder); long InsCod,Ctr_Order_t SelectedOrder);
unsigned Ctr_DB_GetCtrsWithPendingDegs (MYSQL_RES **mysql_res); 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); long Ctr_DB_GetInsCodOfCenterByCod (long CtrCod);
void Ctr_DB_GetShortNameOfCenterByCod (long CtrCod,char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]); 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); unsigned Ctr_DB_GetPhotoAttribution (MYSQL_RES **mysql_res,long CtrCod);

View File

@ -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. 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 CSS_FILE "swad22.57.1.css"
#define JS_FILE "swad22.49.js" #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.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.3: Mar 22, 2023 Code refactoring. (337767 lines)
Version 22.78.2: Mar 22, 2023 Code refactoring in attendance. (337779 lines) Version 22.78.2: Mar 22, 2023 Code refactoring in attendance. (337779 lines)

View File

@ -176,7 +176,7 @@ void Cht_ShowListOfAvailableChatRooms (void)
{ {
/* Get data of this degree */ /* Get data of this degree */
Deg.DegCod = Gbl.Usrs.Me.MyDegs.Degs[NumMyDeg].DegCod; Deg.DegCod = Gbl.Usrs.Me.MyDegs.Degs[NumMyDeg].DegCod;
if (!Deg_GetDataOfDegreeByCod (&Deg)) if (!Deg_GetDegreeDataByCod (&Deg))
Err_WrongDegreeExit (); Err_WrongDegreeExit ();
/* Link to the room of this degree */ /* Link to the room of this degree */
@ -205,7 +205,7 @@ void Cht_ShowListOfAvailableChatRooms (void)
if ((Crs.CrsCod = Str_ConvertStrCodToLongCod (row[0])) > 0) if ((Crs.CrsCod = Str_ConvertStrCodToLongCod (row[0])) > 0)
{ {
/* Get data of this course */ /* Get data of this course */
Crs_GetDataOfCourseByCod (&Crs); Crs_GetCourseDataByCod (&Crs);
/* Link to the room of this course */ /* Link to the room of this course */
IsLastItemInLevel[2] = (NumCrs == NumCrss - 1); IsLastItemInLevel[2] = (NumCrs == NumCrss - 1);
@ -475,7 +475,7 @@ void Cht_OpenChatWindow (void)
/* Get data of this degree */ /* Get data of this degree */
Deg.DegCod = Gbl.Usrs.Me.MyDegs.Degs[NumMyDeg].DegCod; Deg.DegCod = Gbl.Usrs.Me.MyDegs.Degs[NumMyDeg].DegCod;
Deg_GetDataOfDegreeByCod (&Deg); Deg_GetDegreeDataByCod (&Deg);
snprintf (ThisRoomShortName,sizeof (ThisRoomShortName),"%s", snprintf (ThisRoomShortName,sizeof (ThisRoomShortName),"%s",
Deg.ShrtName); Deg.ShrtName);
@ -502,7 +502,7 @@ void Cht_OpenChatWindow (void)
/* Get data of this course */ /* Get data of this course */
Crs.CrsCod = Gbl.Usrs.Me.MyCrss.Crss[NumMyCrs].CrsCod; Crs.CrsCod = Gbl.Usrs.Me.MyCrss.Crss[NumMyCrs].CrsCod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetCourseDataByCod (&Crs);
snprintf (ThisRoomShortName,sizeof (ThisRoomShortName), snprintf (ThisRoomShortName,sizeof (ThisRoomShortName),
"%s", "%s",

View File

@ -150,7 +150,7 @@ void Cty_SeeCtyWithPendingInss (void)
The_GetColorRows (); The_GetColorRows ();
/* Get data of country */ /* Get data of country */
Cty_GetDataOfCountryByCod (&Cty); Cty_GetCountryDataByCod (&Cty);
/* Begin row for this country */ /* Begin row for this country */
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -935,7 +935,7 @@ void Cty_WriteCountryName (long CtyCod)
/***************** Get basic data of country given its code ******************/ /***************** 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; extern const char *Txt_Another_country;
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
@ -973,7 +973,7 @@ bool Cty_GetDataOfCountryByCod (struct Cty_Countr *Cty)
// Here Cty->CtyCod > 0 // Here Cty->CtyCod > 0
/***** Get data of a country from database *****/ /***** 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... if (CtyFound) // Country found...
{ {
/* Get row */ /* Get row */
@ -1191,7 +1191,7 @@ void Cty_RemoveCountry (void)
Cty_EditingCty->CtyCod = ParCod_GetAndCheckPar (ParCod_OthCty); Cty_EditingCty->CtyCod = ParCod_GetAndCheckPar (ParCod_OthCty);
/***** Get data of the country from database *****/ /***** Get data of the country from database *****/
Cty_GetDataOfCountryByCod (Cty_EditingCty); Cty_GetCountryDataByCod (Cty_EditingCty);
/***** Check if this country has users *****/ /***** Check if this country has users *****/
if (Ins_GetNumInssInCty (Cty_EditingCty->CtyCod)) // Country has institutions ==> don't remove 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); Par_GetParText ("Name",NewCtyName,Cty_MAX_BYTES_NAME);
/***** Get from the database the data of the country *****/ /***** Get from the database the data of the country *****/
Cty_GetDataOfCountryByCod (Cty_EditingCty); Cty_GetCountryDataByCod (Cty_EditingCty);
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (NewCtyName[0]) if (NewCtyName[0])
@ -1337,7 +1337,7 @@ void Cty_ChangeCtyWWW (void)
Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
/***** Get from the database the data of the country *****/ /***** 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 *****/ /***** Update the table changing old WWW by new WWW *****/
snprintf (FldName,sizeof (FldName),"Name_%s", 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); Cty.CtyCod = DB_GetNextCode (*mysql_res);
/* Get data of country */ /* Get data of country */
Cty_GetDataOfCountryByCod (&Cty); Cty_GetCountryDataByCod (&Cty);
/* Write data of this country */ /* Write data of this country */
Cty_ListOneCountryForSeeing (&Cty,NumCty); Cty_ListOneCountryForSeeing (&Cty,NumCty);

View File

@ -99,7 +99,7 @@ void Cty_GetFullListOfCountries (void);
void Cty_FreeListCountries (void); void Cty_FreeListCountries (void);
void Cty_WriteSelectorOfCountry (void); void Cty_WriteSelectorOfCountry (void);
void Cty_WriteCountryName (long CtyCod); 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_FlushCacheCountryName (void);
void Cty_GetCountryName (long CtyCod,Lan_Language_t Language, void Cty_GetCountryName (long CtyCod,Lan_Language_t Language,
char CtyName[Cty_MAX_BYTES_NAME + 1]); char CtyName[Cty_MAX_BYTES_NAME + 1]);

View File

@ -289,11 +289,11 @@ static void CtyCfg_Map (void)
Ctr.CtrCod = DB_GetNextCode (mysql_res); Ctr.CtrCod = DB_GetNextCode (mysql_res);
/* Get data of center */ /* Get data of center */
Ctr_GetDataOfCenterByCod (&Ctr); Ctr_GetCenterDataByCod (&Ctr);
/* Get data of institution */ /* Get data of institution */
Ins.InsCod = Ctr.InsCod; Ins.InsCod = Ctr.InsCod;
Ins_GetDataOfInstitByCod (&Ins); Ins_GetInstitDataByCod (&Ins);
/* Add marker */ /* Add marker */
Map_AddMarker (&Ctr.Coord); Map_AddMarker (&Ctr.Coord);

View File

@ -227,7 +227,7 @@ unsigned Cty_DB_GetCtysFull (MYSQL_RES **mysql_res)
/***************** Get basic data of country given its code ******************/ /***************** 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]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];

View File

@ -43,7 +43,7 @@ void Cty_DB_CreateCountry (const struct Cty_Countr *Cty);
unsigned Cty_DB_GetCtysBasic (MYSQL_RES **mysql_res); unsigned Cty_DB_GetCtysBasic (MYSQL_RES **mysql_res);
unsigned Cty_DB_GetCtysWithPendingInss (MYSQL_RES **mysql_res); unsigned Cty_DB_GetCtysWithPendingInss (MYSQL_RES **mysql_res);
unsigned Cty_DB_GetCtysFull (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, void Cty_DB_GetCountryName (long CtyCod,Lan_Language_t Language,
char CtyName[Cty_MAX_BYTES_NAME + 1]); char CtyName[Cty_MAX_BYTES_NAME + 1]);

View File

@ -210,7 +210,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Get data of this institution *****/ /***** Get data of this institution *****/
Hie.Cty.CtyCod = Str_ConvertStrCodToLongCod (row[0]); Hie.Cty.CtyCod = Str_ConvertStrCodToLongCod (row[0]);
if (!Cty_GetDataOfCountryByCod (&Hie.Cty)) if (!Cty_GetCountryDataByCod (&Hie.Cty))
Err_WrongCountrExit (); Err_WrongCountrExit ();
/***** Write link to country *****/ /***** Write link to country *****/
@ -244,7 +244,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Get data of this institution *****/ /***** Get data of this institution *****/
Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[0]); Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[0]);
if (!Ins_GetDataOfInstitByCod (&Hie.Ins)) if (!Ins_GetInstitDataByCod (&Hie.Ins))
Err_WrongInstitExit (); Err_WrongInstitExit ();
/***** Write link to institution *****/ /***** Write link to institution *****/
@ -278,7 +278,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Get data of this center *****/ /***** Get data of this center *****/
Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[0]); Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[0]);
if (!Ctr_GetDataOfCenterByCod (&Hie.Ctr)) if (!Ctr_GetCenterDataByCod (&Hie.Ctr))
Err_WrongCenterExit (); Err_WrongCenterExit ();
/***** Write link to center *****/ /***** Write link to center *****/
@ -312,7 +312,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Get data of this degree *****/ /***** Get data of this degree *****/
Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[0]); Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[0]);
if (!Deg_GetDataOfDegreeByCod (&Hie.Deg)) if (!Deg_GetDegreeDataByCod (&Hie.Deg))
Err_WrongDegreeExit (); Err_WrongDegreeExit ();
/***** Write link to degree *****/ /***** Write link to degree *****/
@ -346,7 +346,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Get data of this course *****/ /***** Get data of this course *****/
Hie.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[0]); Hie.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[0]);
if (!Crs_GetDataOfCourseByCod (&Hie.Crs)) if (!Crs_GetCourseDataByCod (&Hie.Crs))
Err_WrongCourseExit (); Err_WrongCourseExit ();
/***** Write link to course *****/ /***** Write link to course *****/
@ -1579,7 +1579,7 @@ void Crs_RemoveCourse (void)
Crs_EditingCrs->CrsCod = ParCod_GetAndCheckPar (ParCod_OthHie); Crs_EditingCrs->CrsCod = ParCod_GetAndCheckPar (ParCod_OthHie);
/***** Get data of the course from database *****/ /***** Get data of the course from database *****/
Crs_GetDataOfCourseByCod (Crs_EditingCrs); Crs_GetCourseDataByCod (Crs_EditingCrs);
if (Crs_CheckIfICanEdit (Crs_EditingCrs)) if (Crs_CheckIfICanEdit (Crs_EditingCrs))
{ {
@ -1610,7 +1610,7 @@ void Crs_RemoveCourse (void)
/********************* Get data of a course from its code ********************/ /********************* 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; MYSQL_RES *mysql_res;
bool CrsFound = false; bool CrsFound = false;
@ -1627,7 +1627,7 @@ bool Crs_GetDataOfCourseByCod (struct Crs_Course *Crs)
if (Crs->CrsCod > 0) if (Crs->CrsCod > 0)
{ {
/***** Get data of a course from database *****/ /***** 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 *****/ /***** Get data of the course *****/
Crs_GetCourseDataFromRow (mysql_res,Crs); Crs_GetCourseDataFromRow (mysql_res,Crs);
@ -1714,7 +1714,7 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
{ {
/***** Get course data *****/ /***** Get course data *****/
Crs.CrsCod = CrsCod; Crs.CrsCod = CrsCod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetCourseDataByCod (&Crs);
/***** Remove all students in the course *****/ /***** Remove all students in the course *****/
Enr_RemAllStdsInCrs (&Crs); Enr_RemAllStdsInCrs (&Crs);
@ -1754,7 +1754,7 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
Prj_RemoveCrsProjects (CrsCod); Prj_RemoveCrsProjects (CrsCod);
/***** Remove attendance events of the course *****/ /***** Remove attendance events of the course *****/
Att_RemoveCrsAttEvents (CrsCod); Att_RemoveCrsEvents (CrsCod);
/***** Remove notices in the course *****/ /***** Remove notices in the course *****/
Not_DB_RemoveCrsNotices (CrsCod); Not_DB_RemoveCrsNotices (CrsCod);
@ -1821,7 +1821,7 @@ void Crs_ChangeInsCrsCod (void)
Par_GetParText ("InsCrsCod",NewInstitutionalCrsCod,Crs_MAX_BYTES_INSTITUTIONAL_CRS_COD); Par_GetParText ("InsCrsCod",NewInstitutionalCrsCod,Crs_MAX_BYTES_INSTITUTIONAL_CRS_COD);
/* Get data of the course */ /* Get data of the course */
Crs_GetDataOfCourseByCod (Crs_EditingCrs); Crs_GetCourseDataByCod (Crs_EditingCrs);
if (Crs_CheckIfICanEdit (Crs_EditingCrs)) if (Crs_CheckIfICanEdit (Crs_EditingCrs))
{ {
@ -1867,7 +1867,7 @@ void Crs_ChangeCrsYear (void)
Par_GetParText ("OthCrsYear",YearStr,2); Par_GetParText ("OthCrsYear",YearStr,2);
NewYear = Deg_ConvStrToYear (YearStr); NewYear = Deg_ConvStrToYear (YearStr);
Crs_GetDataOfCourseByCod (Crs_EditingCrs); Crs_GetCourseDataByCod (Crs_EditingCrs);
if (Crs_CheckIfICanEdit (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); Par_GetParText (ParName,NewCrsName,MaxBytes);
/***** Get from the database the data of the degree *****/ /***** Get from the database the data of the degree *****/
Crs_GetDataOfCourseByCod (Crs); Crs_GetCourseDataByCod (Crs);
if (Crs_CheckIfICanEdit (Crs)) if (Crs_CheckIfICanEdit (Crs))
{ {
@ -2056,7 +2056,7 @@ void Crs_ChangeCrsStatus (void)
Status = Hie_GetParStatus (); // New status Status = Hie_GetParStatus (); // New status
/***** Get data of course *****/ /***** Get data of course *****/
Crs_GetDataOfCourseByCod (Crs_EditingCrs); Crs_GetCourseDataByCod (Crs_EditingCrs);
/***** Update status *****/ /***** Update status *****/
Crs_DB_UpdateCrsStatus (Crs_EditingCrs->CrsCod,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]) *****/ /***** Get degree code (row[0]) *****/
if ((Deg.DegCod = Str_ConvertStrCodToLongCod (row[0])) <= 0) if ((Deg.DegCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
Err_WrongDegreeExit (); Err_WrongDegreeExit ();
if (!Deg_GetDataOfDegreeByCod (&Deg)) if (!Deg_GetDegreeDataByCod (&Deg))
Err_WrongDegreeExit (); Err_WrongDegreeExit ();
/***** Get course code (row[1]) *****/ /***** Get course code (row[1]) *****/

View File

@ -107,7 +107,7 @@ void Crs_ReceiveFormReqCrs (void);
void Crs_ReceiveFormNewCrs (void); void Crs_ReceiveFormNewCrs (void);
void Crs_RemoveCourse (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_RemoveCourseCompletely (long CrsCod);
void Crs_ChangeInsCrsCod (void); void Crs_ChangeInsCrsCod (void);
void Crs_ChangeCrsYear (void); void Crs_ChangeCrsYear (void);

View File

@ -479,7 +479,7 @@ void CrsCfg_ChangeCrsDeg (void)
if (NewDeg.DegCod != Gbl.Hierarchy.Crs.DegCod) if (NewDeg.DegCod != Gbl.Hierarchy.Crs.DegCod)
{ {
/***** Get data of new degree *****/ /***** Get data of new degree *****/
Deg_GetDataOfDegreeByCod (&NewDeg); Deg_GetDegreeDataByCod (&NewDeg);
/***** If name of course was in database in the new degree... *****/ /***** If name of course was in database in the new degree... *****/
if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg ("ShortName",Gbl.Hierarchy.Crs.ShrtName,-1L, if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg ("ShortName",Gbl.Hierarchy.Crs.ShrtName,-1L,

View File

@ -126,7 +126,7 @@ unsigned Crs_DB_GetCrssInCurrentDegFull (MYSQL_RES **mysql_res)
/********************* Get data of a course from its code ********************/ /********************* 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of a course", DB_QuerySELECT (mysql_res,"can not get data of a course",

View File

@ -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_GetCrssInDeg (MYSQL_RES **mysql_res,long DegCod);
unsigned Crs_DB_GetCrssInCurrentDegBasic (MYSQL_RES **mysql_res); unsigned Crs_DB_GetCrssInCurrentDegBasic (MYSQL_RES **mysql_res);
unsigned Crs_DB_GetCrssInCurrentDegFull (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); long Crs_DB_GetCurrentDegCodFromCurrentCrsCod (void);
void Crs_DB_GetShortNamesByCod (long CrsCod, void Crs_DB_GetShortNamesByCod (long CrsCod,
char CrsShortName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1], char CrsShortName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1],

View File

@ -156,7 +156,7 @@ void Deg_SeeDegWithPendingCrss (void)
The_GetColorRows (); The_GetColorRows ();
/* Get data of degree */ /* Get data of degree */
Deg_GetDataOfDegreeByCod (&Deg); Deg_GetDegreeDataByCod (&Deg);
/* Begin table row */ /* Begin table row */
HTM_TR_Begin (NULL); 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 *****/ /***** Get data of type of degree of this degree *****/
DegTyp.DegTypCod = Deg->DegTypCod; DegTyp.DegTypCod = Deg->DegTypCod;
if (!DegTyp_GetDataOfDegreeTypeByCod (&DegTyp)) if (!DegTyp_GetDegreeTypeDataByCod (&DegTyp))
Err_WrongDegTypExit (); Err_WrongDegTypExit ();
if (Deg->Status & Hie_STATUS_BIT_PENDING) if (Deg->Status & Hie_STATUS_BIT_PENDING)
@ -1004,7 +1004,6 @@ void Deg_GetListDegsInCurrentCtr (void)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
unsigned NumDeg; unsigned NumDeg;
struct Deg_Degree *Deg;
/***** Get degrees of the current center from database *****/ /***** Get degrees of the current center from database *****/
Gbl.Hierarchy.Degs.Num = Deg_DB_GetDegsOfCurrentCtrFull (&mysql_res); Gbl.Hierarchy.Degs.Num = Deg_DB_GetDegsOfCurrentCtrFull (&mysql_res);
@ -1138,7 +1137,7 @@ void Deg_RemoveDegree (void)
Deg_EditingDeg->DegCod = ParCod_GetAndCheckPar (ParCod_OthHie); Deg_EditingDeg->DegCod = ParCod_GetAndCheckPar (ParCod_OthHie);
/***** Get data of degree *****/ /***** Get data of degree *****/
Deg_GetDataOfDegreeByCod (Deg_EditingDeg); Deg_GetDegreeDataByCod (Deg_EditingDeg);
/***** Check if this degree has courses *****/ /***** Check if this degree has courses *****/
if (Crs_GetNumCrssInDeg (Deg_EditingDeg->DegCod)) // Degree has courses ==> don't remove 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 // Returns true if degree found
bool Deg_GetDataOfDegreeByCod (struct Deg_Degree *Deg) bool Deg_GetDegreeDataByCod (struct Deg_Degree *Deg)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
bool DegFound = false; bool DegFound = false;
@ -1181,7 +1180,7 @@ bool Deg_GetDataOfDegreeByCod (struct Deg_Degree *Deg)
if (Deg->DegCod > 0) if (Deg->DegCod > 0)
{ {
/***** Get data of a degree from database *****/ /***** 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 *****/ /***** Get data of degree *****/
Deg_GetDegreeDataFromRow (mysql_res,Deg); 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); Par_GetParText (ParName,NewDegName,MaxBytes);
/***** Get data of degree *****/ /***** Get data of degree *****/
Deg_GetDataOfDegreeByCod (Deg); Deg_GetDegreeDataByCod (Deg);
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (NewDegName[0]) if (NewDegName[0])
@ -1404,7 +1403,7 @@ void Deg_ChangeDegreeType (void)
NewDegTypCod = ParCod_GetAndCheckPar (ParCod_OthDegTyp); NewDegTypCod = ParCod_GetAndCheckPar (ParCod_OthDegTyp);
/***** Get data of degree *****/ /***** Get data of degree *****/
Deg_GetDataOfDegreeByCod (Deg_EditingDeg); Deg_GetDegreeDataByCod (Deg_EditingDeg);
/***** Update the table of degrees changing old type by new type *****/ /***** Update the table of degrees changing old type by new type *****/
Deg_DB_UpdateDegTyp (Deg_EditingDeg->DegCod,NewDegTypCod); Deg_DB_UpdateDegTyp (Deg_EditingDeg->DegCod,NewDegTypCod);
@ -1437,7 +1436,7 @@ void Deg_ChangeDegWWW (void)
Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
/***** Get data of degree *****/ /***** Get data of degree *****/
Deg_GetDataOfDegreeByCod (Deg_EditingDeg); Deg_GetDegreeDataByCod (Deg_EditingDeg);
/***** Check if new WWW is empty *****/ /***** Check if new WWW is empty *****/
if (NewWWW[0]) if (NewWWW[0])
@ -1476,7 +1475,7 @@ void Deg_ChangeDegStatus (void)
Status = Hie_GetParStatus (); // New status Status = Hie_GetParStatus (); // New status
/***** Get data of degree *****/ /***** Get data of degree *****/
Deg_GetDataOfDegreeByCod (Deg_EditingDeg); Deg_GetDegreeDataByCod (Deg_EditingDeg);
/***** Update status *****/ /***** Update status *****/
Deg_DB_UpdateDegStatus (Deg_EditingDeg->DegCod,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); Deg.DegCod = DB_GetNextCode (*mysql_res);
/* Get data of degree */ /* Get data of degree */
Deg_GetDataOfDegreeByCod (&Deg); Deg_GetDegreeDataByCod (&Deg);
/* Write data of this degree */ /* Write data of this degree */
Deg_ListOneDegreeForSeeing (&Deg,NumDeg); Deg_ListOneDegreeForSeeing (&Deg,NumDeg);

View File

@ -92,7 +92,7 @@ void Deg_ReceiveFormReqDeg (void);
void Deg_ReceiveFormNewDeg (void); void Deg_ReceiveFormNewDeg (void);
void Deg_RemoveDegree (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_RemoveDegreeCompletely (long DegCod);
void Deg_RenameDegreeShort (void); void Deg_RenameDegreeShort (void);
void Deg_RenameDegreeFull (void); void Deg_RenameDegreeFull (void);

View File

@ -367,7 +367,7 @@ void DegCfg_ChangeDegCtr (void)
if (NewCtr.CtrCod != Gbl.Hierarchy.Deg.CtrCod) if (NewCtr.CtrCod != Gbl.Hierarchy.Deg.CtrCod)
{ {
/***** Get data of new center *****/ /***** 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 *****/ /***** 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)) if (Deg_DB_CheckIfDegNameExistsInCtr ("ShortName",Gbl.Hierarchy.Deg.ShrtName,Gbl.Hierarchy.Deg.DegCod,NewCtr.CtrCod))

View File

@ -280,7 +280,7 @@ void Deg_DB_GetDegTypeNameByCod (struct DegTyp_DegreeType *DegTyp)
/********************* Get data of a degree from its code ********************/ /********************* 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of a degree", DB_QuerySELECT (mysql_res,"can not get data of a degree",

View File

@ -44,7 +44,7 @@ unsigned Deg_DB_GetNumDegreeTypes (HieLvl_Level_t Scope);
unsigned Deg_DB_GetDegreeTypes (MYSQL_RES **mysql_res, unsigned Deg_DB_GetDegreeTypes (MYSQL_RES **mysql_res,
HieLvl_Level_t Scope,DegTyp_Order_t Order); HieLvl_Level_t Scope,DegTyp_Order_t Order);
void Deg_DB_GetDegTypeNameByCod (struct DegTyp_DegreeType *DegTyp); 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_GetInsCodOfDegreeByCod (long DegCod);
long Deg_DB_GetCtrCodOfDegreeByCod (long DegCod); long Deg_DB_GetCtrCodOfDegreeByCod (long DegCod);
void Deg_DB_GetShortNameOfDegreeByCod (long DegCod,char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]); void Deg_DB_GetShortNameOfDegreeByCod (long DegCod,char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]);

View File

@ -704,7 +704,7 @@ void DegTyp_RemoveDegreeType (void)
DegTyp_EditingDegTyp->DegTypCod = ParCod_GetAndCheckPar (ParCod_OthDegTyp); DegTyp_EditingDegTyp->DegTypCod = ParCod_GetAndCheckPar (ParCod_OthDegTyp);
/***** Get data of the degree type from database *****/ /***** Get data of the degree type from database *****/
if (!DegTyp_GetDataOfDegreeTypeByCod (DegTyp_EditingDegTyp)) if (!DegTyp_GetDegreeTypeDataByCod (DegTyp_EditingDegTyp))
Err_WrongDegTypExit (); Err_WrongDegTypExit ();
/***** Check if this degree type has degrees *****/ /***** 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 ******************/ /****************** 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 *****/ /***** Trivial check: code of degree type should be >= 0 *****/
if (DegTyp->DegTypCod <= 0) if (DegTyp->DegTypCod <= 0)
@ -817,7 +817,7 @@ void DegTyp_RenameDegreeType (void)
Par_GetParText ("DegTypName",NewNameDegTyp,DegTyp_MAX_BYTES_DEGREE_TYPE_NAME); Par_GetParText ("DegTypName",NewNameDegTyp,DegTyp_MAX_BYTES_DEGREE_TYPE_NAME);
/***** Get from the database the old name of the degree type *****/ /***** Get from the database the old name of the degree type *****/
if (!DegTyp_GetDataOfDegreeTypeByCod (DegTyp_EditingDegTyp)) if (!DegTyp_GetDegreeTypeDataByCod (DegTyp_EditingDegTyp))
Err_WrongDegTypExit (); Err_WrongDegTypExit ();
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/

View File

@ -83,7 +83,7 @@ void DegTyp_ReceiveFormNewDegreeType (void);
void DegTyp_RemoveDegreeType (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_RenameDegreeType (void);
void DegTyp_ContEditAfterChgDegTyp (void); void DegTyp_ContEditAfterChgDegTyp (void);

View File

@ -383,7 +383,7 @@ static void Dpt_GetListDepartments (struct Dpt_Departments *Departments,long Ins
/****************** Get data of department using its code ********************/ /****************** 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; extern const char *Txt_Another_department;
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
@ -403,7 +403,7 @@ void Dpt_GetDataOfDepartmentByCod (struct Dpt_Department *Dpt)
else if (Dpt->DptCod > 0) else if (Dpt->DptCod > 0)
{ {
/***** Get data of a department from database *****/ /***** 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 */ /* Get row */
row = mysql_fetch_row (mysql_res); 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 */ /* Get data of institution of this department */
Ins.InsCod = Dpt->InsCod; Ins.InsCod = Dpt->InsCod;
Ins_GetDataOfInstitByCod (&Ins); Ins_GetInstitDataByCod (&Ins);
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -577,7 +577,7 @@ void Dpt_RemoveDepartment (void)
Dpt_EditingDpt->DptCod = ParCod_GetAndCheckPar (ParCod_Dpt); Dpt_EditingDpt->DptCod = ParCod_GetAndCheckPar (ParCod_Dpt);
/***** Get data of the department from database *****/ /***** Get data of the department from database *****/
Dpt_GetDataOfDepartmentByCod (Dpt_EditingDpt); Dpt_GetDepartmentDataByCod (Dpt_EditingDpt);
/***** Check if this department has teachers *****/ /***** Check if this department has teachers *****/
if (Dpt_EditingDpt->NumTchs) // Department has teachers ==> don't remove if (Dpt_EditingDpt->NumTchs) // Department has teachers ==> don't remove
@ -615,7 +615,7 @@ void Dpt_ChangeDepartIns (void)
NewInsCod = ParCod_GetAndCheckPar (ParCod_OthIns); NewInsCod = ParCod_GetAndCheckPar (ParCod_OthIns);
/***** Get data of the department from database *****/ /***** Get data of the department from database *****/
Dpt_GetDataOfDepartmentByCod (Dpt_EditingDpt); Dpt_GetDepartmentDataByCod (Dpt_EditingDpt);
/***** Update institution in table of departments *****/ /***** Update institution in table of departments *****/
Dpt_DB_UpdateDptIns (Dpt_EditingDpt->DptCod,NewInsCod); Dpt_DB_UpdateDptIns (Dpt_EditingDpt->DptCod,NewInsCod);
@ -690,7 +690,7 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
Par_GetParText (ParName,NewDptName,MaxBytes); Par_GetParText (ParName,NewDptName,MaxBytes);
/***** Get from the database the old names of the department *****/ /***** Get from the database the old names of the department *****/
Dpt_GetDataOfDepartmentByCod (Dpt_EditingDpt); Dpt_GetDepartmentDataByCod (Dpt_EditingDpt);
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (NewDptName[0]) if (NewDptName[0])
@ -746,7 +746,7 @@ void Dpt_ChangeDptWWW (void)
Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
/***** Get data of the department from database *****/ /***** Get data of the department from database *****/
Dpt_GetDataOfDepartmentByCod (Dpt_EditingDpt); Dpt_GetDepartmentDataByCod (Dpt_EditingDpt);
/***** Check if new WWW is empty *****/ /***** Check if new WWW is empty *****/
if (NewWWW[0]) if (NewWWW[0])

View File

@ -65,7 +65,7 @@ struct Dpt_Departments
void Dpt_SeeDepts (void); void Dpt_SeeDepts (void);
void Dpt_EditDepartments (void); void Dpt_EditDepartments (void);
void Dpt_FreeListDepartments (struct Dpt_Departments *Departments); 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_RemoveDepartment (void);
void Dpt_ChangeDepartIns (void); void Dpt_ChangeDepartIns (void);
void Dpt_RenameDepartShort (void); void Dpt_RenameDepartShort (void);

View File

@ -109,7 +109,7 @@ unsigned Dpt_DB_GetListDepartments (MYSQL_RES **mysql_res,
/****************** Get data of department using its code ********************/ /****************** 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of a department", DB_QuerySELECT (mysql_res,"can not get data of a department",

View File

@ -40,7 +40,7 @@ void Dpt_DB_CreateDepartment (const struct Dpt_Department *Dpt);
unsigned Dpt_DB_GetListDepartments (MYSQL_RES **mysql_res, unsigned Dpt_DB_GetListDepartments (MYSQL_RES **mysql_res,
long InsCod,Dpt_Order_t SelectedOrder); 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); bool Dpt_DB_CheckIfDepartmentNameExists (const char *FldName,const char *Name,long DptCod);
unsigned Dpt_DB_GetNumDepartmentsInInstitution (long InsCod); unsigned Dpt_DB_GetNumDepartmentsInInstitution (long InsCod);
unsigned Dpt_DB_GetNumTchsCurrentInsInDepartment (long DptCod); unsigned Dpt_DB_GetNumTchsCurrentInsInDepartment (long DptCod);

View File

@ -2222,9 +2222,9 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected)
/***** Link to course *****/ /***** Link to course *****/
HTM_TD_Begin ("class=\"LT DAT_%s\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"LT DAT_%s\"",The_GetSuffix ());
Crs_GetDataOfCourseByCod (&Crs); Crs_GetCourseDataByCod (&Crs);
Deg.DegCod = Crs.DegCod; Deg.DegCod = Crs.DegCod;
Deg_GetDataOfDegreeByCod (&Deg); Deg_GetDegreeDataByCod (&Deg);
Frm_BeginFormGoTo (ActSeeCrsInf); Frm_BeginFormGoTo (ActSeeCrsInf);
ParCod_PutPar (ParCod_Crs,Crs.CrsCod); ParCod_PutPar (ParCod_Crs,Crs.CrsCod);
@ -3104,7 +3104,7 @@ static void Enr_EffectivelyRemUsrFromCrs (struct Usr_Data *UsrDat,
if (Enr_CheckIfUsrBelongsToCurrentCrs (UsrDat)) if (Enr_CheckIfUsrBelongsToCurrentCrs (UsrDat))
{ {
/***** Remove user from all attendance events in course *****/ /***** 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 *****/ /***** Remove user from all groups in course *****/
Grp_RemUsrFromAllGrpsInCrs (UsrDat->UsrCod,Crs->CrsCod); Grp_RemUsrFromAllGrpsInCrs (UsrDat->UsrCod,Crs->CrsCod);

View File

@ -284,7 +284,7 @@ void Exa_ListAllExams (struct Exa_Exams *Exams)
{ {
/* Get data of this exam */ /* Get data of this exam */
Exams->Exam.ExaCod = Exams->Lst[NumExam - 1].ExaCod; Exams->Exam.ExaCod = Exams->Lst[NumExam - 1].ExaCod;
Exa_GetDataOfExamByCod (&Exams->Exam); Exa_GetExamDataByCod (&Exams->Exam);
/* Show exam */ /* Show exam */
Exa_ShowOneExam (Exams, Exa_ShowOneExam (Exams,
@ -417,7 +417,7 @@ void Exa_SeeOneExam (void)
Exa_GetPars (&Exams,true); Exa_GetPars (&Exams,true);
/***** Get exam data *****/ /***** Get exam data *****/
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
/***** Show exam *****/ /***** Show exam *****/
Exa_ShowOnlyOneExam (&Exams,&Session, Exa_ShowOnlyOneExam (&Exams,&Session,
@ -875,7 +875,7 @@ void Exa_GetListSelectedExaCods (struct Exa_Exams *Exams)
/********************** Get exam data using its code *************************/ /********************** 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_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -889,7 +889,7 @@ void Exa_GetDataOfExamByCod (struct Exa_Exam *Exam)
} }
/***** Get exam data from database *****/ /***** 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 */ /* Get row */
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
@ -994,7 +994,7 @@ void Exa_AskRemExam (void)
Exa_GetPars (&Exams,true); Exa_GetPars (&Exams,true);
/***** Get data of the exam from database *****/ /***** Get data of the exam from database *****/
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
/***** Show question and button to remove exam *****/ /***** Show question and button to remove exam *****/
Ale_ShowAlertAndButton (ActRemExa,NULL,NULL, Ale_ShowAlertAndButton (ActRemExa,NULL,NULL,
@ -1028,7 +1028,7 @@ void Exa_RemoveExam (void)
Exams.Exam.ExaCod = ParCod_GetAndCheckPar (ParCod_Exa); Exams.Exam.ExaCod = ParCod_GetAndCheckPar (ParCod_Exa);
/***** Get data of the exam from database *****/ /***** Get data of the exam from database *****/
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
/***** Remove exam from all tables *****/ /***** Remove exam from all tables *****/
Exa_RemoveExamFromAllTables (Exams.Exam.ExaCod); Exa_RemoveExamFromAllTables (Exams.Exam.ExaCod);
@ -1216,7 +1216,7 @@ static void Exa_HideUnhideExam (bool Hide)
Exa_GetPars (&Exams,true); Exa_GetPars (&Exams,true);
/***** Get data of the exam from database *****/ /***** Get data of the exam from database *****/
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
/***** Unhide exam *****/ /***** Unhide exam *****/
Exa_DB_HideOrUnhideExam (Exams.Exam.ExaCod,Hide); Exa_DB_HideOrUnhideExam (Exams.Exam.ExaCod,Hide);
@ -1254,7 +1254,7 @@ void Exa_ReqCreatOrEditExam (void)
Exa_ResetExam (&Exams.Exam); Exa_ResetExam (&Exams.Exam);
else else
/* Get exam data from database */ /* Get exam data from database */
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
/***** Put form to create/edit an exam and show sets *****/ /***** Put form to create/edit an exam and show sets *****/
Exa_PutFormsOneExam (&Exams,&Set,ItsANewExam); Exa_PutFormsOneExam (&Exams,&Set,ItsANewExam);
@ -1425,7 +1425,7 @@ void Exa_ReceiveFormExam (void)
// Some data, not received from form, // Some data, not received from form,
// are necessary to show exam and sets of questions again // are necessary to show exam and sets of questions again
if (!ItsANewExam) if (!ItsANewExam)
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
/***** Overwrite some exam data with the data received from form *****/ /***** Overwrite some exam data with the data received from form *****/
Exa_ReceiveExamFieldsFromForm (&Exams.Exam,Txt); Exa_ReceiveExamFieldsFromForm (&Exams.Exam,Txt);

View File

@ -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_GetListExams (struct Exa_Exams *Exams,Exa_Order_t SelectedOrder);
void Exa_GetListSelectedExaCods (struct Exa_Exams *Exams); void Exa_GetListSelectedExaCods (struct Exa_Exams *Exams);
void Exa_GetDataOfExamByCod (struct Exa_Exam *Exam); void Exa_GetExamDataByCod (struct Exa_Exam *Exam);
void Exa_GetDataOfExamByFolder (struct Exa_Exam *Exam); void Exa_GetExamDataByFolder (struct Exa_Exam *Exam);
void Exa_FreeListExams (struct Exa_Exams *Exams); void Exa_FreeListExams (struct Exa_Exams *Exams);
void Exa_AskRemExam (void); void Exa_AskRemExam (void);

View File

@ -183,7 +183,7 @@ unsigned Exa_DB_GetListExams (MYSQL_RES **mysql_res,Exa_Order_t SelectedOrder)
/********************** Get exam data using its code *************************/ /********************** 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get exam data", 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 *************************/ /*********************** 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get set data", 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 ********************/ /******************* 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get sessions", 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 *****************/ /**************** 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of an exam print", 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 *********/ /******** Get data of an exam print using session code and user code *********/
/*****************************************************************************/ /*****************************************************************************/
unsigned Exa_DB_GetDataOfPrintBySesCodAndUsrCod (MYSQL_RES **mysql_res, unsigned Exa_DB_GetPrintDataBySesCodAndUsrCod (MYSQL_RES **mysql_res,
long SesCod,long UsrCod) long SesCod,long UsrCod)
{ {
return (unsigned) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of an exam print", DB_QuerySELECT (mysql_res,"can not get data of an exam print",

View File

@ -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_UpdateExam (const struct Exa_Exam *Exam,const char *Txt);
void Exa_DB_HideOrUnhideExam (long ExaCod,bool Hide); void Exa_DB_HideOrUnhideExam (long ExaCod,bool Hide);
unsigned Exa_DB_GetListExams (MYSQL_RES **mysql_res,Exa_Order_t SelectedOrder); 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); 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_GetExamTitle (long ExaCod,char Title[Exa_MAX_BYTES_TITLE + 1]);
void Exa_DB_GetExamTxt (long ExaCod,char Txt[Cns_MAX_BYTES_TEXT + 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_GetNumSetsExam (long ExaCod);
unsigned Exa_DB_GetNumQstsExam (long ExaCod); unsigned Exa_DB_GetNumQstsExam (long ExaCod);
unsigned Exa_DB_GetExamSets (MYSQL_RES **mysql_res,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, bool Exa_DB_CheckIfSimilarSetExists (const struct ExaSet_Set *Set,
const char Title[ExaSet_MAX_BYTES_TITLE + 1]); const char Title[ExaSet_MAX_BYTES_TITLE + 1]);
unsigned Exa_DB_GetSetIndFromSetCod (long ExaCod,long SetCod); 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_GetNumSessionsInExam (long ExaCod);
unsigned Exa_DB_GetNumOpenSessionsInExam (long ExaCod); unsigned Exa_DB_GetNumOpenSessionsInExam (long ExaCod);
unsigned Exa_DB_GetSessions (MYSQL_RES **mysql_res,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_ToggleVisResultsSesUsr (const struct ExaSes_Session *Session);
void Exa_DB_HideUnhideSession (const struct ExaSes_Session *Session,bool Hide); void Exa_DB_HideUnhideSession (const struct ExaSes_Session *Session,bool Hide);
void Exa_DB_RemoveSessionFromAllTables (long SesCod); void Exa_DB_RemoveSessionFromAllTables (long SesCod);
@ -135,9 +135,9 @@ void Exa_DB_RemoveGroup (long GrpCod);
//---------------------------------- Prints ----------------------------------- //---------------------------------- Prints -----------------------------------
long Exa_DB_CreatePrint (const struct ExaPrn_Print *Print); long Exa_DB_CreatePrint (const struct ExaPrn_Print *Print);
void Exa_DB_UpdatePrint (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_GetPrintDataByPrnCod (MYSQL_RES **mysql_res,long PrnCod);
unsigned Exa_DB_GetDataOfPrintBySesCodAndUsrCod (MYSQL_RES **mysql_res, unsigned Exa_DB_GetPrintDataBySesCodAndUsrCod (MYSQL_RES **mysql_res,
long SesCod,long UsrCod); long SesCod,long UsrCod);
void Exa_DB_RemoveAllPrintsMadeByUsrInAllCrss (long UsrCod); void Exa_DB_RemoveAllPrintsMadeByUsrInAllCrss (long UsrCod);
void Exa_DB_RemoveAllPrintsMadeByUsrInCrs (long UsrCod,long CrsCod); void Exa_DB_RemoveAllPrintsMadeByUsrInCrs (long UsrCod,long CrsCod);
void Exa_DB_RemoveAllPrintsFromSes (long SesCod); void Exa_DB_RemoveAllPrintsFromSes (long SesCod);

View File

@ -62,9 +62,9 @@ extern struct Globals Gbl;
/***************************** Private prototypes ****************************/ /***************************** Private prototypes ****************************/
/*****************************************************************************/ /*****************************************************************************/
static void ExaPrn_GetDataOfPrint (struct ExaPrn_Print *Print, static void ExaPrn_GetPrintDataFromRow (MYSQL_RES **mysql_res,
MYSQL_RES **mysql_res, struct ExaPrn_Print *Print,
unsigned NumPrints); unsigned NumPrints);
static void ExaPrn_GetQuestionsForNewPrintFromDB (struct ExaPrn_Print *Print,long ExaCod); static void ExaPrn_GetQuestionsForNewPrintFromDB (struct ExaPrn_Print *Print,long ExaCod);
static unsigned ExaPrn_GetSomeQstsFromSetToPrint (struct ExaPrn_Print *Print, static unsigned ExaPrn_GetSomeQstsFromSetToPrint (struct ExaPrn_Print *Print,
@ -185,7 +185,7 @@ void ExaPrn_ShowExamPrint (void)
Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
/***** Get exam print data from database *****/ /***** Get exam print data from database *****/
ExaPrn_GetDataOfPrintBySesCodAndUsrCod (&Print); ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print);
if (Print.PrnCod <= 0) // Exam print does not exists ==> create it if (Print.PrnCod <= 0) // Exam print does not exists ==> create it
{ {
@ -210,7 +210,7 @@ void ExaPrn_ShowExamPrint (void)
else // Exam print exists else // Exam print exists
{ {
/***** Get exam print data from database *****/ /***** Get exam print data from database *****/
ExaPrn_GetDataOfPrintBySesCodAndUsrCod (&Print); ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print);
/***** Get questions and current user's answers from database *****/ /***** Get questions and current user's answers from database *****/
ExaPrn_GetPrintQuestionsFromDB (&Print); ExaPrn_GetPrintQuestionsFromDB (&Print);
@ -233,43 +233,43 @@ void ExaPrn_ShowExamPrint (void)
/**************** Get data of an exam print using print code *****************/ /**************** 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; MYSQL_RES *mysql_res;
unsigned NumPrints; unsigned NumPrints;
/***** Make database query *****/ /***** Make database query *****/
NumPrints = Exa_DB_GetDataOfPrintByPrnCod (&mysql_res,Print->PrnCod); NumPrints = Exa_DB_GetPrintDataByPrnCod (&mysql_res,Print->PrnCod);
/***** Get data of print *****/ /***** 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 *********/ /******** 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; MYSQL_RES *mysql_res;
unsigned NumPrints; unsigned NumPrints;
/***** Make database query *****/ /***** Make database query *****/
NumPrints = Exa_DB_GetDataOfPrintBySesCodAndUsrCod (&mysql_res, NumPrints = Exa_DB_GetPrintDataBySesCodAndUsrCod (&mysql_res,
Print->SesCod, Print->SesCod,
Print->UsrCod); Print->UsrCod);
/***** Get data of print *****/ /***** Get data of print *****/
ExaPrn_GetDataOfPrint (Print,&mysql_res,NumPrints); ExaPrn_GetPrintDataFromRow (&mysql_res,Print,NumPrints);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************* Get assignment data *******************************/ /************************* Get assignment data *******************************/
/*****************************************************************************/ /*****************************************************************************/
static void ExaPrn_GetDataOfPrint (struct ExaPrn_Print *Print, static void ExaPrn_GetPrintDataFromRow (MYSQL_RES **mysql_res,
MYSQL_RES **mysql_res, struct ExaPrn_Print *Print,
unsigned NumPrints) unsigned NumPrints)
{ {
MYSQL_ROW row; MYSQL_ROW row;
@ -691,7 +691,7 @@ static void ExaPrn_WriteQstAndAnsToFill (const struct ExaPrn_Print *Print,
{ {
/***** Get data of this set *****/ /***** Get data of this set *****/
CurrentSet.SetCod = Print->PrintedQuestions[QstInd].SetCod; CurrentSet.SetCod = Print->PrintedQuestions[QstInd].SetCod;
ExaSet_GetDataOfSetByCod (&CurrentSet); ExaSet_GetSetDataByCod (&CurrentSet);
/***** Title for this set *****/ /***** Title for this set *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -960,20 +960,20 @@ void ExaPrn_ReceivePrintAnswer (void)
/***** Get print data *****/ /***** Get print data *****/
Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
ExaPrn_GetDataOfPrintBySesCodAndUsrCod (&Print); ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print);
if (Print.PrnCod <= 0) if (Print.PrnCod <= 0)
Err_WrongExamExit (); Err_WrongExamExit ();
/***** Get session data *****/ /***** Get session data *****/
Session.SesCod = Print.SesCod; Session.SesCod = Print.SesCod;
ExaSes_GetDataOfSessionByCod (&Session); ExaSes_GetSessionDataByCod (&Session);
if (Session.SesCod <= 0) if (Session.SesCod <= 0)
Err_WrongExamExit (); Err_WrongExamExit ();
Exams.SesCod = Session.SesCod; Exams.SesCod = Session.SesCod;
/***** Get exam data *****/ /***** Get exam data *****/
Exams.Exam.ExaCod = Session.ExaCod; Exams.Exam.ExaCod = Session.ExaCod;
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
if (Exams.Exam.ExaCod <= 0) if (Exams.Exam.ExaCod <= 0)
Err_WrongExamExit (); Err_WrongExamExit ();
if (Exams.Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod) if (Exams.Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod)

View File

@ -80,8 +80,8 @@ void ExaPrn_ResetPrint (struct ExaPrn_Print *Print);
void ExaPrn_ShowExamPrint (void); void ExaPrn_ShowExamPrint (void);
void ExaPrn_GetDataOfPrintByPrnCod (struct ExaPrn_Print *Print); void ExaPrn_GetPrintDataByPrnCod (struct ExaPrn_Print *Print);
void ExaPrn_GetDataOfPrintBySesCodAndUsrCod (struct ExaPrn_Print *Print); void ExaPrn_GetPrintDataBySesCodAndUsrCod (struct ExaPrn_Print *Print);
void ExaPrn_GetPrintQuestionsFromDB (struct ExaPrn_Print *Print); void ExaPrn_GetPrintQuestionsFromDB (struct ExaPrn_Print *Print);

View File

@ -198,7 +198,7 @@ void ExaRes_ShowMyResultsInExa (void)
Exa_GetPars (&Exams,true); Exa_GetPars (&Exams,true);
/***** Get exam data from database *****/ /***** Get exam data from database *****/
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
/***** Exam begin *****/ /***** Exam begin *****/
Exa_ShowOnlyOneExamBegin (&Exams,&Session, Exa_ShowOnlyOneExamBegin (&Exams,&Session,
@ -245,8 +245,8 @@ void ExaRes_ShowMyResultsInSes (void)
/***** Get parameters *****/ /***** Get parameters *****/
Exa_GetPars (&Exams,true); Exa_GetPars (&Exams,true);
Session.SesCod = ParCod_GetAndCheckPar (ParCod_Ses); Session.SesCod = ParCod_GetAndCheckPar (ParCod_Ses);
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
ExaSes_GetDataOfSessionByCod (&Session); ExaSes_GetSessionDataByCod (&Session);
/***** Exam begin *****/ /***** Exam begin *****/
Exa_ShowOnlyOneExamBegin (&Exams,&Session, Exa_ShowOnlyOneExamBegin (&Exams,&Session,
@ -390,7 +390,7 @@ void ExaRes_ShowAllResultsInExa (void)
/***** Get parameters *****/ /***** Get parameters *****/
Exa_GetPars (&Exams,true); Exa_GetPars (&Exams,true);
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
/***** Exam begin *****/ /***** Exam begin *****/
Exa_ShowOnlyOneExamBegin (&Exams,&Session, Exa_ShowOnlyOneExamBegin (&Exams,&Session,
@ -461,8 +461,8 @@ void ExaRes_ShowAllResultsInSes (void)
Session.SesCod = ParCod_GetAndCheckPar (ParCod_Ses); Session.SesCod = ParCod_GetAndCheckPar (ParCod_Ses);
/***** Get exam data and session *****/ /***** Get exam data and session *****/
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
ExaSes_GetDataOfSessionByCod (&Session); ExaSes_GetSessionDataByCod (&Session);
/***** Exam begin *****/ /***** Exam begin *****/
Exa_ShowOnlyOneExamBegin (&Exams,&Session, Exa_ShowOnlyOneExamBegin (&Exams,&Session,
@ -598,7 +598,7 @@ static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams)
{ {
/* Get data of this exam */ /* Get data of this exam */
Exams->Exam.ExaCod = Exams->Lst[NumExam].ExaCod; Exams->Exam.ExaCod = Exams->Lst[NumExam].ExaCod;
Exa_GetDataOfExamByCod (&Exams->Exam); Exa_GetExamDataByCod (&Exams->Exam);
/* Write a row for this session */ /* Write a row for this session */
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -806,13 +806,13 @@ static void ExaRes_ShowResults (struct Exa_Exams *Exams,
Err_WrongExamExit (); Err_WrongExamExit ();
/* Get print data */ /* Get print data */
ExaPrn_GetDataOfPrintByPrnCod (&Print); ExaPrn_GetPrintDataByPrnCod (&Print);
/* Get data of session and exam */ /* Get data of session and exam */
Session.SesCod = Print.SesCod; Session.SesCod = Print.SesCod;
ExaSes_GetDataOfSessionByCod (&Session); ExaSes_GetSessionDataByCod (&Session);
Exam.ExaCod = Session.ExaCod; Exam.ExaCod = Session.ExaCod;
Exa_GetDataOfExamByCod (&Exam); Exa_GetExamDataByCod (&Exam);
/* Check if I can view this print result and its score */ /* Check if I can view this print result and its score */
ExaRes_CheckIfICanViewResult (&Exam,&Session,UsrDat->UsrCod,&ICanView); ExaRes_CheckIfICanViewResult (&Exam,&Session,UsrDat->UsrCod,&ICanView);
@ -1249,7 +1249,7 @@ void ExaRes_ShowExaResultAfterFinish (void)
/***** Get exam print data *****/ /***** Get exam print data *****/
Print.SesCod = Session.SesCod; Print.SesCod = Session.SesCod;
Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
ExaPrn_GetDataOfPrintBySesCodAndUsrCod (&Print); ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print);
/***** Set log action and print code *****/ /***** Set log action and print code *****/
// The user has clicked on the "I have finished" button in an exam print // 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 *****/ /***** Get exam print data *****/
Print.SesCod = Session.SesCod; Print.SesCod = Session.SesCod;
Print.UsrCod = UsrDat->UsrCod; Print.UsrCod = UsrDat->UsrCod;
ExaPrn_GetDataOfPrintBySesCodAndUsrCod (&Print); ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print);
/***** Get questions and user's answers of exam print from database *****/ /***** Get questions and user's answers of exam print from database *****/
ExaPrn_GetPrintQuestionsFromDB (&Print); ExaPrn_GetPrintQuestionsFromDB (&Print);

View File

@ -206,7 +206,7 @@ void ExaSes_ListSessions (struct Exa_Exams *Exams,
/******************* Get exam session data using its code ********************/ /******************* 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; MYSQL_RES *mysql_res;
@ -219,7 +219,7 @@ void ExaSes_GetDataOfSessionByCod (struct ExaSes_Session *Session)
} }
/***** Get exam data session from database *****/ /***** 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 */ /* Get exam session data from row */
ExaSes_GetSessionDataFromRow (mysql_res,Session); ExaSes_GetSessionDataFromRow (mysql_res,Session);
else else
@ -853,7 +853,7 @@ void ExaSes_RemoveSession (void)
Session.Title); Session.Title);
/***** Get exam data again to update it after changes in session *****/ /***** Get exam data again to update it after changes in session *****/
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
/***** Show current exam *****/ /***** Show current exam *****/
Exa_ShowOnlyOneExam (&Exams,&Session, Exa_ShowOnlyOneExam (&Exams,&Session,
@ -944,12 +944,12 @@ void ExaSes_GetAndCheckPars (struct Exa_Exams *Exams,
Session->SesCod = ParCod_GetAndCheckPar (ParCod_Ses); Session->SesCod = ParCod_GetAndCheckPar (ParCod_Ses);
/***** Get exam data from database *****/ /***** Get exam data from database *****/
Exa_GetDataOfExamByCod (&Exams->Exam); Exa_GetExamDataByCod (&Exams->Exam);
if (Exams->Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod) if (Exams->Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod)
Err_WrongExamExit (); Err_WrongExamExit ();
/***** Get set data from database *****/ /***** Get set data from database *****/
ExaSes_GetDataOfSessionByCod (Session); ExaSes_GetSessionDataByCod (Session);
if (Session->ExaCod != Exams->Exam.ExaCod) if (Session->ExaCod != Exams->Exam.ExaCod)
Err_WrongSetExit (); Err_WrongSetExit ();
Exams->SesCod = Session->SesCod; Exams->SesCod = Session->SesCod;
@ -1127,7 +1127,7 @@ void ExaSes_ReqCreatOrEditSes (void)
ItsANewSession = (Session.SesCod <= 0); ItsANewSession = (Session.SesCod <= 0);
/***** Get exam data from database *****/ /***** Get exam data from database *****/
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
if (Exams.Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod) if (Exams.Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod)
Err_WrongExamExit (); Err_WrongExamExit ();
@ -1138,7 +1138,7 @@ void ExaSes_ReqCreatOrEditSes (void)
else else
{ {
/* Get session data from database */ /* Get session data from database */
ExaSes_GetDataOfSessionByCod (&Session); ExaSes_GetSessionDataByCod (&Session);
if (Exams.Exam.ExaCod != Session.ExaCod) if (Exams.Exam.ExaCod != Session.ExaCod)
Err_WrongExamExit (); Err_WrongExamExit ();
Exams.SesCod = Session.SesCod; Exams.SesCod = Session.SesCod;
@ -1173,7 +1173,7 @@ void ExaSes_ReceiveFormSession (void)
ItsANewSession = (Session.SesCod <= 0); ItsANewSession = (Session.SesCod <= 0);
/***** Get exam data from database *****/ /***** Get exam data from database *****/
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
if (Exams.Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod) if (Exams.Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod)
Err_WrongExamExit (); Err_WrongExamExit ();
@ -1187,7 +1187,7 @@ void ExaSes_ReceiveFormSession (void)
else else
{ {
/* Get session data from database */ /* Get session data from database */
ExaSes_GetDataOfSessionByCod (&Session); ExaSes_GetSessionDataByCod (&Session);
if (Session.ExaCod != Exams.Exam.ExaCod) if (Session.ExaCod != Exams.Exam.ExaCod)
Err_WrongExamExit (); Err_WrongExamExit ();
Exams.SesCod = Session.SesCod; Exams.SesCod = Session.SesCod;
@ -1225,7 +1225,7 @@ void ExaSes_ReceiveFormSession (void)
Ale_ShowAlert (Ale_SUCCESS,Txt_The_event_has_been_modified); Ale_ShowAlert (Ale_SUCCESS,Txt_The_event_has_been_modified);
/***** Get exam data again to update it after changes in session *****/ /***** Get exam data again to update it after changes in session *****/
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
/***** Show current exam *****/ /***** Show current exam *****/
Exa_ShowOnlyOneExam (&Exams,&Session, Exa_ShowOnlyOneExam (&Exams,&Session,

View File

@ -53,7 +53,7 @@ void ExaSes_ResetSession (struct ExaSes_Session *Session);
void ExaSes_ListSessions (struct Exa_Exams *Exams, void ExaSes_ListSessions (struct Exa_Exams *Exams,
struct ExaSes_Session *Session, struct ExaSes_Session *Session,
bool PutFormSession); bool PutFormSession);
void ExaSes_GetDataOfSessionByCod (struct ExaSes_Session *Session); void ExaSes_GetSessionDataByCod (struct ExaSes_Session *Session);
void ExaSes_ToggleVisResultsSesUsr (void); void ExaSes_ToggleVisResultsSesUsr (void);

View File

@ -150,7 +150,7 @@ static void ExaSet_PutParsOneQst (void *Exams)
/*********************** Get set data using its code *************************/ /*********************** 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_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -164,7 +164,7 @@ void ExaSet_GetDataOfSetByCod (struct ExaSet_Set *Set)
} }
/***** Get data of set of questions from database *****/ /***** 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 */ /* Get row */
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
@ -284,7 +284,7 @@ void ExaSet_ReceiveFormSet (void)
Set.ExaCod = Exams.Exam.ExaCod; Set.ExaCod = Exams.Exam.ExaCod;
/***** Get exam data from database *****/ /***** Get exam data from database *****/
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
/***** Check if exam is editable *****/ /***** Check if exam is editable *****/
if (!Exa_CheckIfEditable (&Exams.Exam)) if (!Exa_CheckIfEditable (&Exams.Exam))
@ -482,7 +482,7 @@ void ExaSet_ReqCreatOrEditSet (void)
ItsANewSet = (Set.SetCod <= 0); ItsANewSet = (Set.SetCod <= 0);
/***** Get exam data from database *****/ /***** Get exam data from database *****/
Exa_GetDataOfExamByCod (&Exams.Exam); Exa_GetExamDataByCod (&Exams.Exam);
Exa_DB_GetExamTxt (Exams.Exam.ExaCod,Txt); Exa_DB_GetExamTxt (Exams.Exam.ExaCod,Txt);
/***** Get set data *****/ /***** Get set data *****/
@ -492,7 +492,7 @@ void ExaSet_ReqCreatOrEditSet (void)
else else
{ {
/* Get set data from database */ /* Get set data from database */
ExaSet_GetDataOfSetByCod (&Set); ExaSet_GetSetDataByCod (&Set);
Exams.SetCod = Set.SetCod; Exams.SetCod = Set.SetCod;
} }
@ -544,7 +544,7 @@ void ExaSet_ListQstsToAddToSet (void)
ExaSet_GetAndCheckPars (&Exams,&Set); ExaSet_GetAndCheckPars (&Exams,&Set);
/***** Get set data from database *****/ /***** Get set data from database *****/
ExaSet_GetDataOfSetByCod (&Set); ExaSet_GetSetDataByCod (&Set);
Exams.SetCod = Set.SetCod; Exams.SetCod = Set.SetCod;
/***** List several test questions for selection *****/ /***** List several test questions for selection *****/
@ -1187,7 +1187,7 @@ void ExaSet_AddQstsToSet (void)
ExaSet_GetAndCheckPars (&Exams,&Set); ExaSet_GetAndCheckPars (&Exams,&Set);
/***** Get set data from database *****/ /***** Get set data from database *****/
ExaSet_GetDataOfSetByCod (&Set); ExaSet_GetSetDataByCod (&Set);
Exams.SetCod = Set.SetCod; Exams.SetCod = Set.SetCod;
/***** Get selected questions *****/ /***** 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); QstCodInSet = Exa_DB_AddQuestionToSet (Set->SetCod,&Question,CloneMedCod);
/***** Get the answers from the database *****/ /***** 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 false); // Don't shuffle
/* /*
row[0] AnsInd row[0] AnsInd
row[1] Answer row[1] Answer
@ -1657,12 +1657,12 @@ static void ExaSet_GetAndCheckPars (struct Exa_Exams *Exams,
Set->SetCod = ParCod_GetAndCheckPar (ParCod_Set); Set->SetCod = ParCod_GetAndCheckPar (ParCod_Set);
/***** Get exam data from database *****/ /***** Get exam data from database *****/
Exa_GetDataOfExamByCod (&Exams->Exam); Exa_GetExamDataByCod (&Exams->Exam);
if (Exams->Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod) if (Exams->Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod)
Err_WrongExamExit (); Err_WrongExamExit ();
/***** Get set data from database *****/ /***** Get set data from database *****/
ExaSet_GetDataOfSetByCod (Set); ExaSet_GetSetDataByCod (Set);
if (Set->ExaCod != Exams->Exam.ExaCod) if (Set->ExaCod != Exams->Exam.ExaCod)
Err_WrongSetExit (); Err_WrongSetExit ();
Exams->SetCod = Set->SetCod; Exams->SetCod = Set->SetCod;

View File

@ -37,7 +37,7 @@
void ExaSet_PutParsOneSet (void *Exams); 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_ReceiveFormSet (void);
void ExaSet_ChangeSetTitle (void); void ExaSet_ChangeSetTitle (void);

View File

@ -1813,13 +1813,13 @@ void For_SetForumName (const struct For_Forum *Forum,
break; break;
case For_FORUM_INSTIT_USRS: case For_FORUM_INSTIT_USRS:
Hie.Ins.InsCod = Forum->Location; Hie.Ins.InsCod = Forum->Location;
if (!Ins_GetDataOfInstitByCod (&Hie.Ins)) if (!Ins_GetInstitDataByCod (&Hie.Ins))
Err_WrongInstitExit (); Err_WrongInstitExit ();
Str_Copy (ForumName,Hie.Ins.ShrtName,For_MAX_BYTES_FORUM_NAME); Str_Copy (ForumName,Hie.Ins.ShrtName,For_MAX_BYTES_FORUM_NAME);
break; break;
case For_FORUM_INSTIT_TCHS: case For_FORUM_INSTIT_TCHS:
Hie.Ins.InsCod = Forum->Location; Hie.Ins.InsCod = Forum->Location;
if (!Ins_GetDataOfInstitByCod (&Hie.Ins)) if (!Ins_GetInstitDataByCod (&Hie.Ins))
Err_WrongInstitExit (); Err_WrongInstitExit ();
snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s", snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s",
Hie.Ins.ShrtName, Hie.Ins.ShrtName,
@ -1828,13 +1828,13 @@ void For_SetForumName (const struct For_Forum *Forum,
break; break;
case For_FORUM_CENTER_USRS: case For_FORUM_CENTER_USRS:
Hie.Ctr.CtrCod = Forum->Location; Hie.Ctr.CtrCod = Forum->Location;
if (!Ctr_GetDataOfCenterByCod (&Hie.Ctr)) if (!Ctr_GetCenterDataByCod (&Hie.Ctr))
Err_WrongCenterExit (); Err_WrongCenterExit ();
Str_Copy (ForumName,Hie.Ctr.ShrtName,For_MAX_BYTES_FORUM_NAME); Str_Copy (ForumName,Hie.Ctr.ShrtName,For_MAX_BYTES_FORUM_NAME);
break; break;
case For_FORUM_CENTER_TCHS: case For_FORUM_CENTER_TCHS:
Hie.Ctr.CtrCod = Forum->Location; Hie.Ctr.CtrCod = Forum->Location;
if (!Ctr_GetDataOfCenterByCod (&Hie.Ctr)) if (!Ctr_GetCenterDataByCod (&Hie.Ctr))
Err_WrongCenterExit (); Err_WrongCenterExit ();
snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s", snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s",
Hie.Ctr.ShrtName, Hie.Ctr.ShrtName,
@ -1843,13 +1843,13 @@ void For_SetForumName (const struct For_Forum *Forum,
break; break;
case For_FORUM_DEGREE_USRS: case For_FORUM_DEGREE_USRS:
Hie.Deg.DegCod = Forum->Location; Hie.Deg.DegCod = Forum->Location;
if (!Deg_GetDataOfDegreeByCod (&Hie.Deg)) if (!Deg_GetDegreeDataByCod (&Hie.Deg))
Err_WrongDegreeExit (); Err_WrongDegreeExit ();
Str_Copy (ForumName,Hie.Deg.ShrtName,For_MAX_BYTES_FORUM_NAME); Str_Copy (ForumName,Hie.Deg.ShrtName,For_MAX_BYTES_FORUM_NAME);
break; break;
case For_FORUM_DEGREE_TCHS: case For_FORUM_DEGREE_TCHS:
Hie.Deg.DegCod = Forum->Location; Hie.Deg.DegCod = Forum->Location;
if (!Deg_GetDataOfDegreeByCod (&Hie.Deg)) if (!Deg_GetDegreeDataByCod (&Hie.Deg))
Err_WrongDegreeExit (); Err_WrongDegreeExit ();
snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s", snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s",
Hie.Deg.ShrtName, Hie.Deg.ShrtName,
@ -1858,13 +1858,13 @@ void For_SetForumName (const struct For_Forum *Forum,
break; break;
case For_FORUM_COURSE_USRS: case For_FORUM_COURSE_USRS:
Hie.Crs.CrsCod = Forum->Location; Hie.Crs.CrsCod = Forum->Location;
if (!Crs_GetDataOfCourseByCod (&Hie.Crs)) if (!Crs_GetCourseDataByCod (&Hie.Crs))
Err_WrongCourseExit (); Err_WrongCourseExit ();
Str_Copy (ForumName,Hie.Crs.ShrtName,For_MAX_BYTES_FORUM_NAME); Str_Copy (ForumName,Hie.Crs.ShrtName,For_MAX_BYTES_FORUM_NAME);
break; break;
case For_FORUM_COURSE_TCHS: case For_FORUM_COURSE_TCHS:
Hie.Crs.CrsCod = Forum->Location; Hie.Crs.CrsCod = Forum->Location;
if (!Crs_GetDataOfCourseByCod (&Hie.Crs)) if (!Crs_GetCourseDataByCod (&Hie.Crs))
Err_WrongCourseExit (); Err_WrongCourseExit ();
snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s", snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s",
Hie.Crs.ShrtName, Hie.Crs.ShrtName,

View File

@ -307,7 +307,7 @@ void Gam_ListAllGames (struct Gam_Games *Games)
{ {
/* Get data of this game */ /* Get data of this game */
Games->Game.GamCod = Games->Lst[NumGame - 1].GamCod; 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 */ /* Show a pair of rows with the main data of this game */
Gam_ShowGameMainData (Games, Gam_ShowGameMainData (Games,
@ -457,7 +457,7 @@ void Gam_SeeOneGame (void)
/***** Get parameters *****/ /***** Get parameters *****/
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
Err_WrongGameExit (); Err_WrongGameExit ();
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
/***** Show game *****/ /***** Show game *****/
Gam_ShowOnlyOneGame (&Games, Gam_ShowOnlyOneGame (&Games,
@ -944,13 +944,13 @@ void Gam_GetListSelectedGamCods (struct Gam_Games *Games)
/********************** Get game data using its code *************************/ /********************** 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_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
/***** Get data of game from database *****/ /***** 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 */ /* Get row */
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
@ -1055,7 +1055,7 @@ void Gam_AskRemGame (void)
Err_WrongGameExit (); Err_WrongGameExit ();
/***** Get data of the game from database *****/ /***** Get data of the game from database *****/
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
if (!Gam_CheckIfICanEditGames ()) if (!Gam_CheckIfICanEditGames ())
Err_NoPermissionExit (); Err_NoPermissionExit ();
@ -1089,7 +1089,7 @@ void Gam_RemoveGame (void)
Games.Game.GamCod = ParCod_GetAndCheckPar (ParCod_Gam); Games.Game.GamCod = ParCod_GetAndCheckPar (ParCod_Gam);
/***** Get data of the game from database *****/ /***** Get data of the game from database *****/
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
if (!Gam_CheckIfICanEditGames ()) if (!Gam_CheckIfICanEditGames ())
Err_NoPermissionExit (); Err_NoPermissionExit ();
@ -1155,7 +1155,7 @@ void Gam_HideGame (void)
Err_WrongGameExit (); Err_WrongGameExit ();
/***** Get data of the game from database *****/ /***** Get data of the game from database *****/
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
if (!Gam_CheckIfICanEditGames ()) if (!Gam_CheckIfICanEditGames ())
Err_NoPermissionExit (); Err_NoPermissionExit ();
@ -1185,7 +1185,7 @@ void Gam_UnhideGame (void)
Err_WrongGameExit (); Err_WrongGameExit ();
/***** Get data of the game from database *****/ /***** Get data of the game from database *****/
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
if (!Gam_CheckIfICanEditGames ()) if (!Gam_CheckIfICanEditGames ())
Err_NoPermissionExit (); Err_NoPermissionExit ();
@ -1220,7 +1220,7 @@ void Gam_ListGame (void)
Err_WrongGameExit (); Err_WrongGameExit ();
/***** Get game data *****/ /***** Get game data *****/
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
Gam_DB_GetGameTxt (Games.Game.GamCod,Txt); Gam_DB_GetGameTxt (Games.Game.GamCod,Txt);
/***** Show game *****/ /***** Show game *****/
@ -1262,7 +1262,7 @@ void Gam_ReqCreatOrEditGame (void)
else else
{ {
/* Get game data from database */ /* Get game data from database */
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
Gam_DB_GetGameTxt (Games.Game.GamCod,Txt); Gam_DB_GetGameTxt (Games.Game.GamCod,Txt);
} }
@ -1542,7 +1542,7 @@ void Gam_ReqSelectQstsToAddToGame (void)
/***** Get parameters *****/ /***** Get parameters *****/
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
Err_WrongGameExit (); Err_WrongGameExit ();
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
/***** Check if game has matches *****/ /***** Check if game has matches *****/
if (!Gam_CheckIfEditable (&Games.Game)) if (!Gam_CheckIfEditable (&Games.Game))
@ -1574,7 +1574,7 @@ void Gam_ListQstsToAddToGame (void)
/***** Get parameters *****/ /***** Get parameters *****/
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
Err_WrongGameExit (); Err_WrongGameExit ();
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
/***** Check if game has matches *****/ /***** Check if game has matches *****/
if (!Gam_CheckIfEditable (&Games.Game)) if (!Gam_CheckIfEditable (&Games.Game))
@ -1823,7 +1823,7 @@ void Gam_AddQstsToGame (void)
/***** Get parameters *****/ /***** Get parameters *****/
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
Err_WrongGameExit (); Err_WrongGameExit ();
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
/***** Check if game has matches *****/ /***** Check if game has matches *****/
if (!Gam_CheckIfEditable (&Games.Game)) if (!Gam_CheckIfEditable (&Games.Game))
@ -1928,7 +1928,7 @@ void Gam_ReqRemQstFromGame (void)
/***** Get parameters *****/ /***** Get parameters *****/
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
Err_WrongGameExit (); Err_WrongGameExit ();
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
/***** Check if game has matches *****/ /***** Check if game has matches *****/
if (!Gam_CheckIfEditable (&Games.Game)) if (!Gam_CheckIfEditable (&Games.Game))
@ -1970,7 +1970,7 @@ void Gam_RemoveQstFromGame (void)
/***** Get parameters *****/ /***** Get parameters *****/
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
Err_WrongGameExit (); Err_WrongGameExit ();
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
/***** Check if game has matches *****/ /***** Check if game has matches *****/
if (!Gam_CheckIfEditable (&Games.Game)) if (!Gam_CheckIfEditable (&Games.Game))
@ -2019,7 +2019,7 @@ void Gam_MoveUpQst (void)
/***** Get parameters *****/ /***** Get parameters *****/
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
Err_WrongGameExit (); Err_WrongGameExit ();
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
/***** Check if game has matches *****/ /***** Check if game has matches *****/
if (!Gam_CheckIfEditable (&Games.Game)) if (!Gam_CheckIfEditable (&Games.Game))
@ -2069,7 +2069,7 @@ void Gam_MoveDownQst (void)
/***** Get parameters *****/ /***** Get parameters *****/
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
Err_WrongGameExit (); Err_WrongGameExit ();
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
/***** Check if game has matches *****/ /***** Check if game has matches *****/
if (!Gam_CheckIfEditable (&Games.Game)) if (!Gam_CheckIfEditable (&Games.Game))
@ -2193,7 +2193,7 @@ void Gam_ReqNewMatch (void)
/***** Get parameters *****/ /***** Get parameters *****/
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
Err_WrongGameExit (); Err_WrongGameExit ();
Gam_GetDataOfGameByCod (&Games.Game); Gam_GetGameDataByCod (&Games.Game);
/***** Show game *****/ /***** Show game *****/
Gam_ShowOnlyOneGame (&Games, Gam_ShowOnlyOneGame (&Games,

View File

@ -123,8 +123,7 @@ long Gam_GetPars (struct Gam_Games *Games);
void Gam_GetListGames (struct Gam_Games *Games,Gam_Order_t SelectedOrder); void Gam_GetListGames (struct Gam_Games *Games,Gam_Order_t SelectedOrder);
void Gam_GetListSelectedGamCods (struct Gam_Games *Games); void Gam_GetListSelectedGamCods (struct Gam_Games *Games);
void Gam_GetDataOfGameByCod (struct Gam_Game *Game); void Gam_GetGameDataByCod (struct Gam_Game *Game);
void Gam_GetDataOfGameByFolder (struct Gam_Game *Game);
void Gam_FreeListGames (struct Gam_Games *Games); void Gam_FreeListGames (struct Gam_Games *Games);
void Gam_AskRemGame (void); void Gam_AskRemGame (void);

View File

@ -202,7 +202,7 @@ unsigned Gam_DB_GetListAvailableGames (MYSQL_RES **mysql_res)
/********************** Get game data using its code *************************/ /********************** 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get game data", DB_QuerySELECT (mysql_res,"can not get game data",

View File

@ -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_GetListGames (MYSQL_RES **mysql_res,Gam_Order_t SelectedOrder);
unsigned Gam_DB_GetListAvailableGames (MYSQL_RES **mysql_res); 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_GetGameTitle (long GamCod,char Title[Gam_MAX_BYTES_TITLE + 1]);
void Gam_DB_GetGameTxt (long GamCod,char Txt[Cns_MAX_BYTES_TEXT + 1]); void Gam_DB_GetGameTxt (long GamCod,char Txt[Cns_MAX_BYTES_TEXT + 1]);
bool Gam_DB_CheckIfSimilarGameExists (const struct Gam_Game *Game); bool Gam_DB_CheckIfSimilarGameExists (const struct Gam_Game *Game);

View File

@ -130,7 +130,7 @@ static void Grp_WriteGrpHead (struct GroupType *GrpTyp);
static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight); static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight);
static void Grp_PutFormToCreateGroupType (void); static void Grp_PutFormToCreateGroupType (void);
static void Grp_PutFormToCreateGroup (const struct Roo_Rooms *Rooms); 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 bool Grp_GetMultipleEnrolmentOfAGroupType (long GrpTypCod);
static void Grp_GetLstCodGrpsUsrBelongs (long UsrCod,long GrpTypCod, static void Grp_GetLstCodGrpsUsrBelongs (long UsrCod,long GrpTypCod,
struct ListCodGrps *LstGrps); struct ListCodGrps *LstGrps);
@ -170,13 +170,13 @@ void Grp_WriteNamesOfSelectedGrps (void)
if ((GrpCod = Gbl.Crs.Grps.LstGrpsSel.GrpCods[NumGrpSel]) >= 0) if ((GrpCod = Gbl.Crs.Grps.LstGrpsSel.GrpCods[NumGrpSel]) >= 0)
{ {
GrpDat.GrpCod = GrpCod; GrpDat.GrpCod = GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
HTM_TxtF ("%s&nbsp;%s",GrpDat.GrpTypName,GrpDat.GrpName); HTM_TxtF ("%s&nbsp;%s",GrpDat.GrpTypName,GrpDat.GrpName);
} }
else // GrpCod < 0 ==> students not belonging to any group of type (-GrpCod) else // GrpCod < 0 ==> students not belonging to any group of type (-GrpCod)
{ {
Gbl.Crs.Grps.GrpTyp.GrpTypCod = -GrpCod; Gbl.Crs.Grps.GrpTyp.GrpTypCod = -GrpCod;
Grp_GetDataOfGroupTypeByCod (&Gbl.Crs.Grps.GrpTyp); Grp_GetGroupTypeDataByCod (&Gbl.Crs.Grps.GrpTyp);
HTM_TxtF ("%s&nbsp;(%s)",Gbl.Crs.Grps.GrpTyp.GrpTypName, HTM_TxtF ("%s&nbsp;(%s)",Gbl.Crs.Grps.GrpTyp.GrpTypName,
Txt_users_with_no_group); Txt_users_with_no_group);
} }
@ -2887,13 +2887,13 @@ void Grp_FreeListGrpTypesAndGrps (void)
/*****************************************************************************/ /*****************************************************************************/
// GrpTyp->GrpTypCod must have the code of the type of group // 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_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
/***** Get data of a type of group from database *****/ /***** 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 (); Err_WrongGrpTypExit ();
/***** Get some data of group type *****/ /***** Get some data of group type *****/
@ -2936,7 +2936,7 @@ static bool Grp_GetMultipleEnrolmentOfAGroupType (long GrpTypCod)
/********************** Get data of a group from its code ********************/ /********************** 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_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -2957,7 +2957,7 @@ void Grp_GetDataOfGroupByCod (struct GroupData *GrpDat)
if (GrpDat->GrpCod > 0) if (GrpDat->GrpCod > 0)
{ {
/***** Get data of a group from database *****/ /***** 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 *****/ /***** Get data of group *****/
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
@ -3393,7 +3393,7 @@ static void Grp_AskConfirmRemGrpTypWithGrps (unsigned NumGrps)
extern const char *Txt_Remove_type_of_group; extern const char *Txt_Remove_type_of_group;
/***** Get data of the group type from database *****/ /***** 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 *****/ /***** Begin section to edit group types *****/
Grp_ReqEditGroupsInternal0 (); Grp_ReqEditGroupsInternal0 ();
@ -3432,7 +3432,7 @@ static void Grp_AskConfirmRemGrp (void)
/***** Get name of the group from database *****/ /***** Get name of the group from database *****/
GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
/***** Count number of students in group *****/ /***** Count number of students in group *****/
NumStds = Grp_DB_CountNumUsrsInGrp (Rol_STD,Gbl.Crs.Grps.GrpCod); 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]; char AlertTxt[256 + Grp_MAX_BYTES_GROUP_TYPE_NAME];
/***** Get name and type of the group from database *****/ /***** 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 *****/ /***** Remove file zones of all groups of this type *****/
Brw_RemoveZonesOfGroupsOfType (Gbl.Crs.Grps.GrpTyp.GrpTypCod); 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 *****/ /***** Get name and type of the group from database *****/
GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
/***** Remove file zones of this group *****/ /***** Remove file zones of this group *****/
Brw_RemoveGrpZones (Gbl.Hierarchy.Crs.CrsCod,GrpDat.GrpCod); Brw_RemoveGrpZones (Gbl.Hierarchy.Crs.CrsCod,GrpDat.GrpCod);
@ -3607,7 +3607,7 @@ void Grp_OpenGroup (void)
/***** Get group data from database *****/ /***** Get group data from database *****/
GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
/***** Update the table of groups changing open/close status *****/ /***** Update the table of groups changing open/close status *****/
Grp_DB_OpenGrp (GrpDat.GrpCod); Grp_DB_OpenGrp (GrpDat.GrpCod);
@ -3637,7 +3637,7 @@ void Grp_CloseGroup (void)
/***** Get group data from database *****/ /***** Get group data from database *****/
GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
/***** Update the table of groups changing open/close status *****/ /***** Update the table of groups changing open/close status *****/
Grp_DB_CloseGrp (Gbl.Crs.Grps.GrpCod); Grp_DB_CloseGrp (Gbl.Crs.Grps.GrpCod);
@ -3667,7 +3667,7 @@ void Grp_EnableFileZonesGrp (void)
/***** Get group data from database *****/ /***** Get group data from database *****/
GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
/***** Update the table of groups changing file zones status *****/ /***** Update the table of groups changing file zones status *****/
Grp_DB_EnableFileZonesGrp (Gbl.Crs.Grps.GrpCod); Grp_DB_EnableFileZonesGrp (Gbl.Crs.Grps.GrpCod);
@ -3698,7 +3698,7 @@ void Grp_DisableFileZonesGrp (void)
/***** Get group data from database *****/ /***** Get group data from database *****/
GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
/***** Update the table of groups changing file zones status *****/ /***** Update the table of groups changing file zones status *****/
Grp_DB_DisableFileZonesGrp (GrpDat.GrpCod); 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 */ /* Get from the database the type and the name of the group */
GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
/***** If group was in database... *****/ /***** If group was in database... *****/
if (Grp_DB_CheckIfGrpNameExistsForGrpTyp (NewGrpTypCod,GrpDat.GrpName,-1L)) 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 */ /* Get from the database the name of the group */
GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
/***** Update the table of groups changing old room by new room *****/ /***** Update the table of groups changing old room by new room *****/
Grp_DB_ChangeRoomOfGrp (Gbl.Crs.Grps.GrpCod,NewRooCod); Grp_DB_ChangeRoomOfGrp (Gbl.Crs.Grps.GrpCod,NewRooCod);
@ -3823,7 +3823,7 @@ void Grp_ChangeMandatGrpTyp (void)
NewMandatoryEnrolment = Par_GetParBool ("MandatoryEnrolment"); NewMandatoryEnrolment = Par_GetParBool ("MandatoryEnrolment");
/* Get from the database the name of the type and the old type of enrolment */ /* 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 /***** Check if the old type of enrolment match the new
(this happens when return is pressed without changes) *****/ (this happens when return is pressed without changes) *****/
@ -3876,7 +3876,7 @@ void Grp_ChangeMultiGrpTyp (void)
NewMultipleEnrolment = Par_GetParBool ("MultipleEnrolment"); NewMultipleEnrolment = Par_GetParBool ("MultipleEnrolment");
/* Get from the database the name of the type and the old type of enrolment */ /* 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 /***** Check if the old type of enrolment match the new one
(this happends when return is pressed without changes) *****/ (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); Gbl.Crs.Grps.GrpTyp.GrpTypCod = ParCod_GetAndCheckPar (ParCod_GrpTyp);
/***** Get from the database the data of this type of group *****/ /***** 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 *****/ /***** Get open time *****/
Gbl.Crs.Grps.GrpTyp.OpenTimeUTC = Dat_GetTimeUTCFromForm (Dat_STR_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 */ /* Get from the database the type, name, and old maximum of students of the group */
GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
/***** Check if the old maximum of students equals the new one /***** Check if the old maximum of students equals the new one
(this happens when return is pressed without changes) *****/ (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); Par_GetParText ("GrpTypName",NewNameGrpTyp,Grp_MAX_BYTES_GROUP_TYPE_NAME);
/***** Get from the database the old name of the group type *****/ /***** 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 *****/ /***** Check if new name is empty *****/
if (NewNameGrpTyp[0]) if (NewNameGrpTyp[0])
@ -4122,7 +4122,7 @@ void Grp_RenameGroup (void)
/***** Get from the database the type and the old name of the group *****/ /***** Get from the database the type and the old name of the group *****/
GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetGroupDataByCod (&GrpDat);
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewNameGrp[0]) if (!NewNameGrp[0])

View File

@ -193,7 +193,7 @@ void Grp_GetListGrpTypesInCurrentCrs (Grp_WhichGroupTypes_t WhichGroupTypes);
void Grp_FreeListGrpTypesAndGrps (void); void Grp_FreeListGrpTypesAndGrps (void);
void Grp_OpenGroupsAutomatically (void); void Grp_OpenGroupsAutomatically (void);
void Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_WhichGroupTypes_t WhichGroupTypes); void Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_WhichGroupTypes_t WhichGroupTypes);
void Grp_GetDataOfGroupByCod (struct GroupData *GrpDat); void Grp_GetGroupDataByCod (struct GroupData *GrpDat);
void Grp_FlushCacheIBelongToGrp (void); void Grp_FlushCacheIBelongToGrp (void);
bool Grp_GetIfIBelongToGrp (long GrpCod); bool Grp_GetIfIBelongToGrp (long GrpCod);

View File

@ -105,7 +105,7 @@ void Grp_DB_CreateGroup (const struct Grp_Groups *Grps)
/******************* Get data of a group type from its code ******************/ /******************* 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get type of group", 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 ********************/ /********************** 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of a group", DB_QuerySELECT (mysql_res,"can not get data of a group",

View File

@ -39,9 +39,9 @@ void Grp_DB_LockTables (void);
long Grp_DB_CreateGroupType (const struct GroupType *GrpTyp); long Grp_DB_CreateGroupType (const struct GroupType *GrpTyp);
void Grp_DB_CreateGroup (const struct Grp_Groups *Grps); 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_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_CheckIfGrpExists (long GrpCod);
bool Grp_DB_CheckIfGrpBelongsToCrs (long GrpCod,long CrsCod); bool Grp_DB_CheckIfGrpBelongsToCrs (long GrpCod,long CrsCod);

View File

@ -558,7 +558,7 @@ void Hie_InitHierarchy (void)
/***** If course code is available, get course data *****/ /***** If course code is available, get course data *****/
if (Gbl.Hierarchy.Crs.CrsCod > 0) 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; Gbl.Hierarchy.Deg.DegCod = Gbl.Hierarchy.Crs.DegCod;
else else
Hie_ResetHierarchy (); Hie_ResetHierarchy ();
@ -567,7 +567,7 @@ void Hie_InitHierarchy (void)
/***** If degree code is available, get degree data *****/ /***** If degree code is available, get degree data *****/
if (Gbl.Hierarchy.Deg.DegCod > 0) 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.Ctr.CtrCod = Gbl.Hierarchy.Deg.CtrCod;
Gbl.Hierarchy.Ins.InsCod = Deg_DB_GetInsCodOfDegreeByCod (Gbl.Hierarchy.Deg.DegCod); 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 center code is available, get center data *****/
if (Gbl.Hierarchy.Ctr.CtrCod > 0) 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; Gbl.Hierarchy.Ins.InsCod = Gbl.Hierarchy.Ctr.InsCod;
else else
Hie_ResetHierarchy (); Hie_ResetHierarchy ();
@ -588,7 +588,7 @@ void Hie_InitHierarchy (void)
/***** If institution code is available, get institution data *****/ /***** If institution code is available, get institution data *****/
if (Gbl.Hierarchy.Ins.InsCod > 0) 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; Gbl.Hierarchy.Cty.CtyCod = Gbl.Hierarchy.Ins.CtyCod;
else else
Hie_ResetHierarchy (); Hie_ResetHierarchy ();
@ -596,7 +596,7 @@ void Hie_InitHierarchy (void)
/***** If country code is available, get country data *****/ /***** If country code is available, get country data *****/
if (Gbl.Hierarchy.Cty.CtyCod > 0) 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 (); Hie_ResetHierarchy ();
/***** Set current hierarchy level and code /***** 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) if ((Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[1])) > 0)
{ {
/* Get data of institution */ /* Get data of institution */
Ins_GetDataOfInstitByCod (&Hie.Ins); Ins_GetInstitDataByCod (&Hie.Ins);
/* Write institution logo and name */ /* Write institution logo and name */
Ins_DrawInstitLogoAndNameWithLink (&Hie.Ins,ActSeeInsInf,"LT"); 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) if ((Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[1])) > 0)
{ {
/* Get data of center */ /* Get data of center */
Ctr_GetDataOfCenterByCod (&Hie.Ctr); Ctr_GetCenterDataByCod (&Hie.Ctr);
/* Write center logo and name */ /* Write center logo and name */
Ctr_DrawCenterLogoAndNameWithLink (&Hie.Ctr,ActSeeCtrInf,"LT"); 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) if ((Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[1])) > 0)
{ {
/* Get data of degree */ /* Get data of degree */
Deg_GetDataOfDegreeByCod (&Hie.Deg); Deg_GetDegreeDataByCod (&Hie.Deg);
/* Write degree logo and name */ /* Write degree logo and name */
Deg_DrawDegreeLogoAndNameWithLink (&Hie.Deg,ActSeeDegInf,"LT"); Deg_DrawDegreeLogoAndNameWithLink (&Hie.Deg,ActSeeDegInf,"LT");

View File

@ -65,7 +65,7 @@ static void Hld_PutIconsSeeHolidays (__attribute__((unused)) void *Args);
static void Hld_EditHolidaysInternal (void); 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_GetParHldType (void);
static Hld_HolidayType_t Hld_GetTypeOfHoliday (const char *UnsignedStr); 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 **************************/ /************************* 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_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -405,7 +405,7 @@ static void Hld_GetDataOfHolidayByCod (struct Hld_Holiday *Hld)
Err_WrongHolidayExit (); Err_WrongHolidayExit ();
/***** Get data of holiday from database *****/ /***** 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 */ /* Get row */
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
@ -650,7 +650,7 @@ void Hld_RemoveHoliday (void)
Hld_EditingHld->HldCod = ParCod_GetAndCheckPar (ParCod_Hld); Hld_EditingHld->HldCod = ParCod_GetAndCheckPar (ParCod_Hld);
/***** Get data of the holiday from database *****/ /***** Get data of the holiday from database *****/
Hld_GetDataOfHolidayByCod (Hld_EditingHld); Hld_GetHolidayDataByCod (Hld_EditingHld);
/***** Remove holiday *****/ /***** Remove holiday *****/
Hld_DB_RemoveHoliday (Hld_EditingHld->HldCod); Hld_DB_RemoveHoliday (Hld_EditingHld->HldCod);
@ -682,10 +682,10 @@ void Hld_ChangeHolidayPlace (void)
NewPlace.PlcCod = ParCod_GetPar (ParCod_Plc); NewPlace.PlcCod = ParCod_GetPar (ParCod_Plc);
/***** Get from the database the data of the place *****/ /***** Get from the database the data of the place *****/
Plc_GetDataOfPlaceByCod (&NewPlace); Plc_GetPlaceDataByCod (&NewPlace);
/***** Get from the database the data of the holiday *****/ /***** Get from the database the data of the holiday *****/
Hld_GetDataOfHolidayByCod (Hld_EditingHld); Hld_GetHolidayDataByCod (Hld_EditingHld);
/***** Update the place in database *****/ /***** Update the place in database *****/
Hld_DB_ChangePlace (Hld_EditingHld->HldCod,NewPlace.PlcCod); Hld_DB_ChangePlace (Hld_EditingHld->HldCod,NewPlace.PlcCod);
@ -714,7 +714,7 @@ void Hld_ChangeHolidayType (void)
Hld_EditingHld->HldCod = ParCod_GetAndCheckPar (ParCod_Hld); Hld_EditingHld->HldCod = ParCod_GetAndCheckPar (ParCod_Hld);
/***** Get from the database the data of the holiday *****/ /***** Get from the database the data of the holiday *****/
Hld_GetDataOfHolidayByCod (Hld_EditingHld); Hld_GetHolidayDataByCod (Hld_EditingHld);
/***** Get the new type for the holiday *****/ /***** Get the new type for the holiday *****/
Hld_EditingHld->HldTyp = Hld_GetParHldType (); Hld_EditingHld->HldTyp = Hld_GetParHldType ();
@ -766,7 +766,7 @@ static void Hld_ChangeDate (Hld_StartOrEndDate_t StartOrEndDate)
Hld_EditingHld->HldCod = ParCod_GetAndCheckPar (ParCod_Hld); Hld_EditingHld->HldCod = ParCod_GetAndCheckPar (ParCod_Hld);
/***** Get from the database the data of the holiday *****/ /***** Get from the database the data of the holiday *****/
Hld_GetDataOfHolidayByCod (Hld_EditingHld); Hld_GetHolidayDataByCod (Hld_EditingHld);
/***** Get the new date for the holiday *****/ /***** Get the new date for the holiday *****/
switch (StartOrEndDate) switch (StartOrEndDate)
@ -833,7 +833,7 @@ void Hld_RenameHoliday (void)
Par_GetParText ("Name",NewHldName,Hld_MAX_BYTES_HOLIDAY_NAME); Par_GetParText ("Name",NewHldName,Hld_MAX_BYTES_HOLIDAY_NAME);
/***** Get from the database the old names of the holiday *****/ /***** Get from the database the old names of the holiday *****/
Hld_GetDataOfHolidayByCod (Hld_EditingHld); Hld_GetHolidayDataByCod (Hld_EditingHld);
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (NewHldName[0]) if (NewHldName[0])

View File

@ -174,7 +174,7 @@ unsigned Hld_DB_GetListHolidays (MYSQL_RES **mysql_res,Hld_Order_t SelectedOrder
/************************* Get holiday data by code **************************/ /************************* 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of a holiday", DB_QuerySELECT (mysql_res,"can not get data of a holiday",

View File

@ -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]); 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_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); void Hld_DB_RemoveHoliday (long HldCod);

View File

@ -175,7 +175,7 @@ void Ins_SeeInsWithPendingCtrs (void)
The_GetColorRows (); The_GetColorRows ();
/* Get data of institution */ /* Get data of institution */
Ins_GetDataOfInstitByCod (&Ins); Ins_GetInstitDataByCod (&Ins);
/* Institution logo and name */ /* Institution logo and name */
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -687,7 +687,7 @@ void Ins_WriteInstitutionNameAndCty (long InsCod)
/************************* Get data of an institution ************************/ /************************* Get data of an institution ************************/
/*****************************************************************************/ /*****************************************************************************/
bool Ins_GetDataOfInstitByCod (struct Ins_Instit *Ins) bool Ins_GetInstitDataByCod (struct Ins_Instit *Ins)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
bool InsFound = false; bool InsFound = false;
@ -705,7 +705,7 @@ bool Ins_GetDataOfInstitByCod (struct Ins_Instit *Ins)
if (Ins->InsCod > 0) if (Ins->InsCod > 0)
{ {
/***** Get data of an institution from database *****/ /***** 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 */ /* Get institution data */
Ins_GetInstitDataFromRow (mysql_res,Ins, 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 *****/ /***** 3. Slow: get short name and country of institution from database *****/
Gbl.Cache.InstitutionShrtNameAndCty.InsCod = Ins->InsCod; 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 */ /* Get row */
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
@ -1108,7 +1108,7 @@ void Ins_RemoveInstitution (void)
Ins_EditingIns->InsCod = ParCod_GetAndCheckPar (ParCod_OthHie); Ins_EditingIns->InsCod = ParCod_GetAndCheckPar (ParCod_OthHie);
/***** Get data of the institution from database *****/ /***** Get data of the institution from database *****/
Ins_GetDataOfInstitByCod (Ins_EditingIns); Ins_GetInstitDataByCod (Ins_EditingIns);
/***** Check if this institution has users *****/ /***** Check if this institution has users *****/
if (!Ins_CheckIfICanEdit (Ins_EditingIns)) 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); Par_GetParText (ParName,NewInsName,MaxBytes);
/***** Get from the database the old names of the institution *****/ /***** Get from the database the old names of the institution *****/
Ins_GetDataOfInstitByCod (Ins); Ins_GetInstitDataByCod (Ins);
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (NewInsName[0]) if (NewInsName[0])
@ -1298,7 +1298,7 @@ void Ins_ChangeInsWWW (void)
Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
/***** Get data of institution *****/ /***** Get data of institution *****/
Ins_GetDataOfInstitByCod (Ins_EditingIns); Ins_GetInstitDataByCod (Ins_EditingIns);
/***** Check if new WWW is empty *****/ /***** Check if new WWW is empty *****/
if (NewWWW[0]) if (NewWWW[0])
@ -1337,7 +1337,7 @@ void Ins_ChangeInsStatus (void)
Status = Hie_GetParStatus (); // New status Status = Hie_GetParStatus (); // New status
/***** Get data of institution *****/ /***** Get data of institution *****/
Ins_GetDataOfInstitByCod (Ins_EditingIns); Ins_GetInstitDataByCod (Ins_EditingIns);
/***** Update status *****/ /***** Update status *****/
Ins_DB_UpdateInsStatus (Ins_EditingIns->InsCod,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); Ins.InsCod = DB_GetNextCode (*mysql_res);
/* Get data of institution */ /* Get data of institution */
Ins_GetDataOfInstitByCod (&Ins); Ins_GetInstitDataByCod (&Ins);
/* Write data of this institution */ /* Write data of this institution */
Ins_ListOneInstitutionForSeeing (&Ins,NumIns); 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]) *****/ /***** Get data of this institution (row[0]) *****/
Ins->InsCod = Str_ConvertStrCodToLongCod (row[0]); Ins->InsCod = Str_ConvertStrCodToLongCod (row[0]);
if (!Ins_GetDataOfInstitByCod (Ins)) if (!Ins_GetInstitDataByCod (Ins))
Err_WrongInstitExit (); Err_WrongInstitExit ();
/***** Get statistic (row[1]) *****/ /***** Get statistic (row[1]) *****/

View File

@ -84,7 +84,7 @@ void Ins_GetBasicListOfInstitutions (long CtyCod);
void Ins_GetFullListOfInstitutions (long CtyCod); void Ins_GetFullListOfInstitutions (long CtyCod);
void Ins_WriteInstitutionNameAndCty (long InsCod); 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_FlushCacheFullNameAndCtyOfInstitution (void);
void Ins_GetShrtNameAndCtyOfInstitution (struct Ins_Instit *Ins, void Ins_GetShrtNameAndCtyOfInstitution (struct Ins_Instit *Ins,
char CtyName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1]); char CtyName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1]);

View File

@ -284,7 +284,7 @@ static void InsCfg_Map (void)
Ctr.CtrCod = DB_GetNextCode (mysql_res); Ctr.CtrCod = DB_GetNextCode (mysql_res);
/* Get data of center */ /* Get data of center */
Ctr_GetDataOfCenterByCod (&Ctr); Ctr_GetCenterDataByCod (&Ctr);
/* Add marker */ /* Add marker */
Map_AddMarker (&Ctr.Coord); Map_AddMarker (&Ctr.Coord);
@ -546,7 +546,7 @@ void InsCfg_ChangeInsCty (void)
if (NewCty.CtyCod != Gbl.Hierarchy.Ins.CtyCod) if (NewCty.CtyCod != Gbl.Hierarchy.Ins.CtyCod)
{ {
/***** Get data of the country from database *****/ /***** 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 *****/ /***** 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)) if (Ins_DB_CheckIfInsNameExistsInCty ("ShortName",Gbl.Hierarchy.Ins.ShrtName,-1L,NewCty.CtyCod))

View File

@ -127,7 +127,7 @@ void Ins_DB_UpdateInsWWW (long InsCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1])
/************************* Get data of an institution ************************/ /************************* 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of an institution", 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 **************/ /*********** 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 *****/ /***** Trivial check: institution code should be > 0 *****/
if (InsCod <= 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 *********/ /******** 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]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];

View File

@ -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_UpdateInsName (long InsCod,const char *FldName,const char *NewInsName);
void Ins_DB_UpdateInsWWW (long InsCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]); void Ins_DB_UpdateInsWWW (long InsCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]);
unsigned Ins_DB_GetDataOfInstitutionByCod (MYSQL_RES **mysql_res,long InsCod); unsigned Ins_DB_GetInsDataByCod (MYSQL_RES **mysql_res,long InsCod);
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]);
unsigned Ins_DB_GetShrtNameAndCtyOfIns (MYSQL_RES **mysql_res,long InsCod); unsigned Ins_DB_GetInsShrtNameAndCty (MYSQL_RES **mysql_res,long InsCod);
bool Ins_DB_CheckIfInsNameExistsInCty (const char *FldName, bool Ins_DB_CheckIfInsNameExistsInCty (const char *FldName,
const char *Name, const char *Name,
long InsCod, long InsCod,

View File

@ -1476,15 +1476,15 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto,
/***** Get data of institution *****/ /***** Get data of institution *****/
Hie.Ins.InsCod = InsCod; Hie.Ins.InsCod = InsCod;
Ins_GetDataOfInstitByCod (&Hie.Ins); Ins_GetInstitDataByCod (&Hie.Ins);
/***** Get data of degree *****/ /***** Get data of degree *****/
Hie.Deg.DegCod = DegCod; Hie.Deg.DegCod = DegCod;
Deg_GetDataOfDegreeByCod (&Hie.Deg); Deg_GetDegreeDataByCod (&Hie.Deg);
/***** Get data of course *****/ /***** Get data of course *****/
Hie.Crs.CrsCod = CrsCod; Hie.Crs.CrsCod = CrsCod;
Crs_GetDataOfCourseByCod (&Hie.Crs); Crs_GetCourseDataByCod (&Hie.Crs);
/***** Begin table *****/ /***** Begin table *****/
HTM_TABLE_BeginWidePadding (10); HTM_TABLE_BeginWidePadding (10);

View File

@ -79,7 +79,7 @@ static void Lnk_EditLinksInternal (void);
static void Lnk_PutIconsEditingLinks (__attribute__((unused)) void *Args); static void Lnk_PutIconsEditingLinks (__attribute__((unused)) void *Args);
static void Lnk_GetListLinks (struct Lnk_Links *Links); 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); static void Lnk_FreeListLinks (struct Lnk_Links *Links);
@ -320,7 +320,7 @@ static void Lnk_GetListLinks (struct Lnk_Links *Links)
NumLnk < Links->Num; NumLnk < Links->Num;
NumLnk++) NumLnk++)
/* Get next link */ /* Get next link */
Lnk_GetDataOfLink (mysql_res,&Links->Lst[NumLnk]); Lnk_GetLinkData (mysql_res,&Links->Lst[NumLnk]);
} }
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
@ -332,7 +332,7 @@ static void Lnk_GetListLinks (struct Lnk_Links *Links)
/**************************** Get link full name *****************************/ /**************************** Get link full name *****************************/
/*****************************************************************************/ /*****************************************************************************/
void Lnk_GetDataOfLinkByCod (struct Lnk_Link *Lnk) void Lnk_GetLinkDataByCod (struct Lnk_Link *Lnk)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
@ -345,8 +345,8 @@ void Lnk_GetDataOfLinkByCod (struct Lnk_Link *Lnk)
if (Lnk->LnkCod > 0) if (Lnk->LnkCod > 0)
{ {
/***** Get data of an institutional link from database *****/ /***** Get data of an institutional link from database *****/
if (Lnk_DB_GetDataOfLinkByCod (&mysql_res,Lnk->LnkCod)) // Link found... if (Lnk_DB_GetLinkDataByCod (&mysql_res,Lnk->LnkCod)) // Link found...
Lnk_GetDataOfLink (mysql_res,Lnk); Lnk_GetLinkData (mysql_res,Lnk);
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
@ -357,7 +357,7 @@ void Lnk_GetDataOfLinkByCod (struct Lnk_Link *Lnk)
/**************************** Get data of link *******************************/ /**************************** 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; MYSQL_ROW row;
@ -498,7 +498,7 @@ void Lnk_RemoveLink (void)
Lnk_EditingLnk->LnkCod = ParCod_GetAndCheckPar (ParCod_Lnk); Lnk_EditingLnk->LnkCod = ParCod_GetAndCheckPar (ParCod_Lnk);
/***** Get data of the link from database *****/ /***** Get data of the link from database *****/
Lnk_GetDataOfLinkByCod (Lnk_EditingLnk); Lnk_GetLinkDataByCod (Lnk_EditingLnk);
/***** Remove link *****/ /***** Remove link *****/
Lnk_DB_RemoveLink (Lnk_EditingLnk->LnkCod); Lnk_DB_RemoveLink (Lnk_EditingLnk->LnkCod);
@ -574,7 +574,7 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
Par_GetParText (ParName,NewLnkName,MaxBytes); Par_GetParText (ParName,NewLnkName,MaxBytes);
/***** Get link data from the database *****/ /***** Get link data from the database *****/
Lnk_GetDataOfLinkByCod (Lnk_EditingLnk); Lnk_GetLinkDataByCod (Lnk_EditingLnk);
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (NewLnkName[0]) if (NewLnkName[0])
@ -630,7 +630,7 @@ void Lnk_ChangeLinkWWW (void)
Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
/***** Get link data from the database *****/ /***** Get link data from the database *****/
Lnk_GetDataOfLinkByCod (Lnk_EditingLnk); Lnk_GetLinkDataByCod (Lnk_EditingLnk);
/***** Check if new WWW is empty *****/ /***** Check if new WWW is empty *****/
if (NewWWW[0]) if (NewWWW[0])

View File

@ -52,7 +52,7 @@ void Lnk_EditLinks (void);
void Lnk_PutIconToViewLinks (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_RemoveLink (void);
void Lnk_RenameLinkShort (void); void Lnk_RenameLinkShort (void);
void Lnk_RenameLinkFull (void); void Lnk_RenameLinkFull (void);

View File

@ -93,7 +93,7 @@ unsigned Lnk_DB_GetLinks (MYSQL_RES **mysql_res)
/**************************** Get link full name *****************************/ /**************************** 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of an institutional link", DB_QuerySELECT (mysql_res,"can not get data of an institutional link",

View File

@ -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]); 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_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); bool Lnk_DB_CheckIfLinkNameExists (const char *FldName,const char *Name,long LnkCod);
void Lnk_DB_RemoveLink (long LnkCod); void Lnk_DB_RemoveLink (long LnkCod);

View File

@ -257,7 +257,7 @@ void Log_GetAndShowLastClicks (void)
Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[5]); Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[5]);
Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[6]); Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[6]);
Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[7]); 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); Ctr_DB_GetShortNameOfCenterByCod (Hie.Ctr.CtrCod,Hie.Ctr.ShrtName);
Deg_DB_GetShortNameOfDegreeByCod (Hie.Deg.DegCod,Hie.Deg.ShrtName); Deg_DB_GetShortNameOfDegreeByCod (Hie.Deg.DegCod,Hie.Deg.ShrtName);

View File

@ -388,7 +388,7 @@ void Mai_WriteWarningEmailNotifications (void)
/**************************** Get mail domain data ***************************/ /**************************** Get mail domain data ***************************/
/*****************************************************************************/ /*****************************************************************************/
void Mai_GetDataOfMailDomainByCod (struct Mail *Mai) void Mai_GetMailDomainDataByCod (struct Mail *Mai)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -400,7 +400,7 @@ void Mai_GetDataOfMailDomainByCod (struct Mail *Mai)
if (Mai->MaiCod > 0) if (Mai->MaiCod > 0)
{ {
/***** Get data of a mail domain from database *****/ /***** 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 */ /* Get row */
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
@ -527,7 +527,7 @@ void Mai_RemoveMailDomain (void)
Mai_EditingMai->MaiCod = ParCod_GetAndCheckPar (ParCod_Mai); Mai_EditingMai->MaiCod = ParCod_GetAndCheckPar (ParCod_Mai);
/***** Get data of the mail domain rom database *****/ /***** Get data of the mail domain rom database *****/
Mai_GetDataOfMailDomainByCod (Mai_EditingMai); Mai_GetMailDomainDataByCod (Mai_EditingMai);
/***** Remove mail domain *****/ /***** Remove mail domain *****/
Mai_DB_RemoveMailDomain (Mai_EditingMai->MaiCod); Mai_DB_RemoveMailDomain (Mai_EditingMai->MaiCod);
@ -603,7 +603,7 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
Par_GetParText (ParName,NewMaiName,MaxBytes); Par_GetParText (ParName,NewMaiName,MaxBytes);
/***** Get from the database the old names of the mail *****/ /***** Get from the database the old names of the mail *****/
Mai_GetDataOfMailDomainByCod (Mai_EditingMai); Mai_GetMailDomainDataByCod (Mai_EditingMai);
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (NewMaiName[0]) if (NewMaiName[0])

View File

@ -66,7 +66,7 @@ void Mai_EditMailDomains (void);
bool Mai_CheckIfUsrCanReceiveEmailNotif (const struct Usr_Data *UsrDat); bool Mai_CheckIfUsrCanReceiveEmailNotif (const struct Usr_Data *UsrDat);
void Mai_WriteWarningEmailNotifications (void); void Mai_WriteWarningEmailNotifications (void);
void Mai_GetDataOfMailDomainByCod (struct Mail *Plc); void Mai_GetMailDomainDataByCod (struct Mail *Plc);
void Mai_RemoveMailDomain (void); void Mai_RemoveMailDomain (void);
void Mai_RenameMailDomainShort (void); void Mai_RenameMailDomainShort (void);
void Mai_RenameMailDomainFull (void); void Mai_RenameMailDomainFull (void);

View File

@ -394,7 +394,7 @@ unsigned Mai_DB_GetMailDomains (MYSQL_RES **mysql_res,Mai_DomainsOrder_t Selecte
/**************************** Get mail domain data ***************************/ /**************************** 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of a mail domain", DB_QuerySELECT (mysql_res,"can not get data of a mail domain",

View File

@ -67,7 +67,7 @@ void Mai_DB_UpdateMailDomainName (long MaiCod,
const char *FldName,const char *NewMaiName); const char *FldName,const char *NewMaiName);
unsigned Mai_DB_GetMailDomains (MYSQL_RES **mysql_res,Mai_DomainsOrder_t SelectedOrder); 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_CheckIfMailDomainNameExists (const char *FldName,const char *Name,long MaiCod);
bool Mai_DB_CheckIfMailDomainIsAllowedForNotif (const char MailDomain[Cns_MAX_BYTES_EMAIL_ADDRESS + 1]); bool Mai_DB_CheckIfMailDomainIsAllowedForNotif (const char MailDomain[Cns_MAX_BYTES_EMAIL_ADDRESS + 1]);

View File

@ -669,7 +669,7 @@ void Mrk_GetNotifMyMarks (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
ID_GetListIDsFromUsrCod (&UsrDat); ID_GetListIDsFromUsrCod (&UsrDat);
/***** Get marks data from database *****/ /***** 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 *****/ /***** Get data of this file of marks *****/
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);

View File

@ -90,7 +90,7 @@ void Mrk_DB_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter,unsigne
/*********************** Get marks data from database ************************/ /*********************** 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get the number of rows" DB_QuerySELECT (mysql_res,"can not get the number of rows"

View File

@ -36,7 +36,7 @@
void Mrk_DB_AddMarks (long FilCod,const struct Mrk_Properties *Marks); void Mrk_DB_AddMarks (long FilCod,const struct Mrk_Properties *Marks);
void Mrk_DB_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter,unsigned NumRows); 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); unsigned Mrk_DB_GetNumRowsHeaderAndFooter (MYSQL_RES **mysql_res);
#endif #endif

View File

@ -322,12 +322,12 @@ void Mch_ListMatches (struct Gam_Games *Games,
/********************** Get match data using its code ************************/ /********************** Get match data using its code ************************/
/*****************************************************************************/ /*****************************************************************************/
void Mch_GetDataOfMatchByCod (struct Mch_Match *Match) void Mch_GetMatchDataByCod (struct Mch_Match *Match)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
/***** Get data of match from database *****/ /***** 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 */ /* Get match data from row */
Mch_GetMatchDataFromRow (mysql_res,Match); Mch_GetMatchDataFromRow (mysql_res,Match);
else else
@ -1146,11 +1146,11 @@ void Mch_GetAndCheckPars (struct Gam_Games *Games,
if ((Games->Game.GamCod = Gam_GetPars (Games)) <= 0) if ((Games->Game.GamCod = Gam_GetPars (Games)) <= 0)
Err_WrongGameExit (); Err_WrongGameExit ();
Grp_GetParWhichGroups (); Grp_GetParWhichGroups ();
Gam_GetDataOfGameByCod (&Games->Game); Gam_GetGameDataByCod (&Games->Game);
/* Get match code */ /* Get match code */
Match->MchCod = ParCod_GetAndCheckPar (ParCod_Mch); Match->MchCod = ParCod_GetAndCheckPar (ParCod_Mch);
Mch_GetDataOfMatchByCod (Match); Mch_GetMatchDataByCod (Match);
/***** Ensure parameters are correct *****/ /***** Ensure parameters are correct *****/
if (Games->Game.GamCod != Match->GamCod) if (Games->Game.GamCod != Match->GamCod)
@ -1447,7 +1447,7 @@ void Mch_ResumeMatch (void)
/***** Get data of the match from database *****/ /***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed (); Match.MchCod = Mch_GetMchCodBeingPlayed ();
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Check if I have permission to resume match *****/ /***** Check if I have permission to resume match *****/
if (!Mch_CheckIfICanEditThisMatch (&Match)) if (!Mch_CheckIfICanEditThisMatch (&Match))
@ -1746,7 +1746,7 @@ void Mch_PlayPauseMatch (void)
/***** Get data of the match from database *****/ /***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed (); Match.MchCod = Mch_GetMchCodBeingPlayed ();
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Update status *****/ /***** Update status *****/
if (Match.Status.Playing) // Match is being played ==> pause it 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 *****/ /***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed (); Match.MchCod = Mch_GetMchCodBeingPlayed ();
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Get number of columns *****/ /***** Get number of columns *****/
Match.Status.NumCols = (unsigned) Match.Status.NumCols = (unsigned)
@ -1819,7 +1819,7 @@ void Mch_ToggleVisResultsMchQst (void)
/***** Get data of the match from database *****/ /***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed (); Match.MchCod = Mch_GetMchCodBeingPlayed ();
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Update status *****/ /***** Update status *****/
Match.Status.ShowQstResults = !Match.Status.ShowQstResults; // Toggle display Match.Status.ShowQstResults = !Match.Status.ShowQstResults; // Toggle display
@ -1854,7 +1854,7 @@ void Mch_BackMatch (void)
/***** Get data of the match from database *****/ /***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed (); Match.MchCod = Mch_GetMchCodBeingPlayed ();
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Update status *****/ /***** Update status *****/
Mch_SetMatchStatusToPrev (&Match); Mch_SetMatchStatusToPrev (&Match);
@ -1886,7 +1886,7 @@ void Mch_ForwardMatch (void)
/***** Get data of the match from database *****/ /***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed (); Match.MchCod = Mch_GetMchCodBeingPlayed ();
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Update status *****/ /***** Update status *****/
Mch_SetMatchStatusToNext (&Match); Mch_SetMatchStatusToNext (&Match);
@ -3359,7 +3359,7 @@ void Mch_JoinMatchAsStd (void)
/***** Get data of the match from database *****/ /***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed (); Match.MchCod = Mch_GetMchCodBeingPlayed ();
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Show current match status *****/ /***** Show current match status *****/
HTM_DIV_Begin ("id=\"match\" class=\"MCH_CONT\""); HTM_DIV_Begin ("id=\"match\" class=\"MCH_CONT\"");
@ -3381,7 +3381,7 @@ void Mch_RemMyQstAnsAndShowMchStatus (void)
/***** Get data of the match from database *****/ /***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed (); Match.MchCod = Mch_GetMchCodBeingPlayed ();
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Get question index from form *****/ /***** Get question index from form *****/
QstInd = Gam_GetParQstInd (); QstInd = Gam_GetParQstInd ();
@ -3437,7 +3437,7 @@ void Mch_StartCountdown (void)
/***** Get data of the match from database *****/ /***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed (); Match.MchCod = Mch_GetMchCodBeingPlayed ();
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Start countdown *****/ /***** Start countdown *****/
Match.Status.Countdown = NewCountdown; Match.Status.Countdown = NewCountdown;
@ -3471,7 +3471,7 @@ void Mch_RefreshMatchTch (void)
/***** Get data of the match from database *****/ /***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed (); Match.MchCod = Mch_GetMchCodBeingPlayed ();
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Update countdown *****/ /***** Update countdown *****/
// If current countdown is < 0 ==> no countdown in progress // If current countdown is < 0 ==> no countdown in progress
@ -3526,7 +3526,7 @@ void Mch_RefreshMatchStd (void)
/***** Get data of the match from database *****/ /***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed (); Match.MchCod = Mch_GetMchCodBeingPlayed ();
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Show current match status *****/ /***** Show current match status *****/
Mch_ShowMatchStatusForStd (&Match,Mch_REFRESH_STATUS_BY_SERVER); Mch_ShowMatchStatusForStd (&Match,Mch_REFRESH_STATUS_BY_SERVER);
@ -3579,7 +3579,7 @@ void Mch_ReceiveQuestionAnswer (void)
/***** Get data of the match from database *****/ /***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed (); Match.MchCod = Mch_GetMchCodBeingPlayed ();
Mch_GetDataOfMatchByCod (&Match); Mch_GetMatchDataByCod (&Match);
/***** Get question index from form *****/ /***** Get question index from form *****/
QstInd = Gam_GetParQstInd (); QstInd = Gam_GetParQstInd ();

View File

@ -96,7 +96,7 @@ void Mch_ResetMatch (struct Mch_Match *Match);
void Mch_ListMatches (struct Gam_Games *Games, void Mch_ListMatches (struct Gam_Games *Games,
bool PutFormNewMatch); 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_ListOneOrMoreMatchesAuthor (const struct Mch_Match *Match);
void Mch_ListOneOrMoreMatchesTimes (const struct Mch_Match *Match,unsigned UniqueId); void Mch_ListOneOrMoreMatchesTimes (const struct Mch_Match *Match,unsigned UniqueId);
void Mch_ListOneOrMoreMatchesNumPlayers (const struct Mch_Match *Match); void Mch_ListOneOrMoreMatchesNumPlayers (const struct Mch_Match *Match);

View File

@ -170,7 +170,7 @@ void Mch_DB_UpdateVisResultsMchUsr (long MchCod,bool ShowUsrResults)
/********************** Get match data using its code ************************/ /********************** 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) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get matches", DB_QuerySELECT (mysql_res,"can not get matches",

Some files were not shown because too many files have changed in this diff Show More