mirror of https://github.com/acanas/swad-core.git
Version 23.3: Sep 14, 2023 Buttons to close browser tab in matches are replaced because they no longer work in Firefox.
This commit is contained in:
parent
2ee8712203
commit
304be2889e
202
swad_API.c
202
swad_API.c
|
@ -912,20 +912,20 @@ int swad__loginBySessionKey (struct soap *soap,
|
|||
row = mysql_fetch_row (mysql_res);
|
||||
|
||||
/***** Get course (row[2]) *****/
|
||||
Gbl.Hierarchy.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[2]);
|
||||
Gbl.Hierarchy.Crs.Cod = Str_ConvertStrCodToLongCod (row[2]);
|
||||
Crs_GetCourseDataByCod (&Gbl.Hierarchy.Crs);
|
||||
loginBySessionKeyOut->courseCode = (int) Gbl.Hierarchy.Crs.CrsCod;
|
||||
loginBySessionKeyOut->courseCode = (int) Gbl.Hierarchy.Crs.Cod;
|
||||
Str_Copy (loginBySessionKeyOut->courseName,Gbl.Hierarchy.Crs.FullName,
|
||||
Cns_HIERARCHY_MAX_BYTES_FULL_NAME);
|
||||
|
||||
/***** Get user code (row[0]) *****/
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||
UsrFound = API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Me.UsrDat,Gbl.Hierarchy.Crs.CrsCod); // Get some user's data from database
|
||||
UsrFound = API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Me.UsrDat,Gbl.Hierarchy.Crs.Cod); // Get some user's data from database
|
||||
|
||||
/***** Get degree (row[1]) *****/
|
||||
Gbl.Hierarchy.Deg.DegCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
Gbl.Hierarchy.Deg.Cod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
Deg_GetDegreeDataByCod (&Gbl.Hierarchy.Deg);
|
||||
loginBySessionKeyOut->degreeCode = (int) Gbl.Hierarchy.Deg.DegCod;
|
||||
loginBySessionKeyOut->degreeCode = (int) Gbl.Hierarchy.Deg.Cod;
|
||||
Str_Copy (loginBySessionKeyOut->degreeName,Gbl.Hierarchy.Deg.FullName,
|
||||
Cns_HIERARCHY_MAX_BYTES_FULL_NAME);
|
||||
}
|
||||
|
@ -936,7 +936,7 @@ int swad__loginBySessionKey (struct soap *soap,
|
|||
DB_FreeMySQLResult (&mysql_res);
|
||||
|
||||
/***** Get degree of current course *****/
|
||||
Gbl.Hierarchy.Deg.DegCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
Gbl.Hierarchy.Deg.Cod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
|
||||
if (UsrFound)
|
||||
{
|
||||
|
@ -997,7 +997,7 @@ int swad__getAvailableRoles (struct soap *soap,
|
|||
Gbl.WebService.Function = API_getAvailableRoles;
|
||||
|
||||
/***** Initialize hierarchy *****/
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
Hie_InitHierarchy ();
|
||||
|
||||
/***** Default value returned on error *****/
|
||||
|
@ -1217,7 +1217,7 @@ int swad__getCourseInfo (struct soap *soap,
|
|||
Gbl.WebService.Function = API_getCourseInfo;
|
||||
|
||||
/***** Initialize hierarchy *****/
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
Hie_InitHierarchy ();
|
||||
|
||||
/***** Check web service key *****/
|
||||
|
@ -1230,12 +1230,12 @@ int swad__getCourseInfo (struct soap *soap,
|
|||
|
||||
/***** Check course and group codes *****/
|
||||
if ((ReturnCode = API_CheckCourseAndGroupCodes (soap,
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Gbl.Hierarchy.Crs.Cod,
|
||||
-1L)) != SOAP_OK)
|
||||
return ReturnCode;
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -1265,7 +1265,7 @@ int swad__getCourseInfo (struct soap *soap,
|
|||
"Unknown requested info type");
|
||||
Gbl.Crs.Info.Type = InfoType;
|
||||
Inf_GetAndCheckInfoSrcFromDB (&Syllabus,
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Gbl.Hierarchy.Crs.Cod,
|
||||
Gbl.Crs.Info.Type,
|
||||
&FromDB);
|
||||
Length = strlen (NamesInWSForInfoSrc[FromDB.Src]);
|
||||
|
@ -1329,7 +1329,7 @@ static int API_WriteSyllabusIntoHTMLBuffer (struct soap *soap,
|
|||
*HTMLBuffer = NULL;
|
||||
|
||||
/***** Load syllabus from XML file to list of items in memory *****/
|
||||
Syl_LoadListItemsSyllabusIntoMemory (Syllabus,Gbl.Hierarchy.Crs.CrsCod);
|
||||
Syl_LoadListItemsSyllabusIntoMemory (Syllabus,Gbl.Hierarchy.Crs.Cod);
|
||||
|
||||
if (Syl_LstItemsSyllabus.NumItems)
|
||||
{
|
||||
|
@ -1405,7 +1405,7 @@ static int API_WritePlainTextIntoHTMLBuffer (struct soap *soap,
|
|||
*HTMLBuffer = NULL;
|
||||
|
||||
/***** Get info text from database *****/
|
||||
Inf_GetInfoTxtFromDB (Gbl.Hierarchy.Crs.CrsCod,Gbl.Crs.Info.Type,
|
||||
Inf_GetInfoTxtFromDB (Gbl.Hierarchy.Crs.Cod,Gbl.Crs.Info.Type,
|
||||
TxtHTML,NULL);
|
||||
|
||||
if (TxtHTML[0])
|
||||
|
@ -1490,7 +1490,7 @@ static int API_WritePageIntoHTMLBuffer (struct soap *soap,
|
|||
*HTMLBuffer = NULL;
|
||||
|
||||
/***** Build path of directory containing web page *****/
|
||||
Inf_BuildPathPage (Gbl.Hierarchy.Crs.CrsCod,Gbl.Crs.Info.Type,PathRelDirHTML);
|
||||
Inf_BuildPathPage (Gbl.Hierarchy.Crs.Cod,Gbl.Crs.Info.Type,PathRelDirHTML);
|
||||
|
||||
/***** Open file with web page *****/
|
||||
/* 1. Check if index.html exists */
|
||||
|
@ -1560,7 +1560,7 @@ int swad__getUsers (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_getUsers;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (courseCode > 0) ? (long) courseCode :
|
||||
Gbl.Hierarchy.Crs.Cod = (courseCode > 0) ? (long) courseCode :
|
||||
-1L;
|
||||
|
||||
/***** Check web service key *****/
|
||||
|
@ -1573,12 +1573,12 @@ int swad__getUsers (struct soap *soap,
|
|||
|
||||
/***** Check course *****/
|
||||
if ((ReturnCode = API_CheckCourseAndGroupCodes (soap,
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Gbl.Hierarchy.Crs.Cod,
|
||||
-1L)) != SOAP_OK)
|
||||
return ReturnCode;
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -1594,7 +1594,7 @@ int swad__getUsers (struct soap *soap,
|
|||
"Requester must belong to course");
|
||||
|
||||
/***** Get degree of current course *****/
|
||||
Gbl.Hierarchy.Deg.DegCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
Gbl.Hierarchy.Deg.Cod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
|
||||
/***** Check requested users' role *****/
|
||||
if (userRole != API_ROLE_STUDENT && // Students
|
||||
|
@ -1641,7 +1641,7 @@ int swad__findUsers (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_findUsers;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (courseCode > 0) ? (long) courseCode :
|
||||
Gbl.Hierarchy.Crs.Cod = (courseCode > 0) ? (long) courseCode :
|
||||
-1L;
|
||||
|
||||
/***** Check web service key *****/
|
||||
|
@ -1655,12 +1655,12 @@ int swad__findUsers (struct soap *soap,
|
|||
if (Gbl.Hierarchy.Level == HieLvl_CRS) // Course selected
|
||||
/***** Check course *****/
|
||||
if ((ReturnCode = API_CheckCourseAndGroupCodes (soap,
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Gbl.Hierarchy.Crs.Cod,
|
||||
-1L)) != SOAP_OK)
|
||||
return ReturnCode;
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -1678,7 +1678,7 @@ int swad__findUsers (struct soap *soap,
|
|||
|
||||
if (Gbl.Hierarchy.Level == HieLvl_CRS)
|
||||
/***** Get degree of current course *****/
|
||||
Gbl.Hierarchy.Deg.DegCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
Gbl.Hierarchy.Deg.Cod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
|
||||
/***** Check requested users' role *****/
|
||||
if (userRole < API_ROLE_UNKNOWN ||
|
||||
|
@ -1807,7 +1807,7 @@ int swad__getGroupTypes (struct soap *soap,
|
|||
Gbl.WebService.Function = API_getGroupTypes;
|
||||
|
||||
/***** Initialize hierarchy *****/
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
Hie_InitHierarchy ();
|
||||
|
||||
/***** Open groups of this course that must be opened
|
||||
|
@ -1823,13 +1823,13 @@ int swad__getGroupTypes (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** Check if course code is correct *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
|
||||
if (Gbl.Hierarchy.Crs.Cod <= 0)
|
||||
return soap_sender_fault (soap,
|
||||
"Bad course code",
|
||||
"Course code must be a integer greater than 0");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -1921,7 +1921,7 @@ int swad__getGroups (struct soap *soap,
|
|||
Gbl.WebService.Function = API_getGroups;
|
||||
|
||||
/***** Initialize hierarchy *****/
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
Hie_InitHierarchy ();
|
||||
|
||||
/***** Open groups of this course that must be opened
|
||||
|
@ -1937,13 +1937,13 @@ int swad__getGroups (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** Check if course code is correct *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
|
||||
if (Gbl.Hierarchy.Crs.Cod <= 0)
|
||||
return soap_sender_fault (soap,
|
||||
"Bad course code",
|
||||
"Course code must be a integer greater than 0");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -2048,7 +2048,7 @@ int swad__sendMyGroups (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_sendMyGroups;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
|
||||
/***** Check web service key *****/
|
||||
if ((ReturnCode = API_CheckAPIKey (wsKey)) != SOAP_OK)
|
||||
|
@ -2059,13 +2059,13 @@ int swad__sendMyGroups (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** Check if course code is correct *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
|
||||
if (Gbl.Hierarchy.Crs.Cod <= 0)
|
||||
return soap_sender_fault (soap,
|
||||
"Bad course code",
|
||||
"Course code must be a integer greater than 0");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -2254,7 +2254,7 @@ int swad__getAttendanceEvents (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_getAttendanceEvents;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
|
||||
/***** Check web service key *****/
|
||||
if ((ReturnCode = API_CheckAPIKey (wsKey)) != SOAP_OK)
|
||||
|
@ -2265,13 +2265,13 @@ int swad__getAttendanceEvents (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** Check if course code is correct *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
|
||||
if (Gbl.Hierarchy.Crs.Cod <= 0)
|
||||
return soap_sender_fault (soap,
|
||||
"Bad course code",
|
||||
"Course code must be a integer greater than 0");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -2312,7 +2312,7 @@ int swad__getAttendanceEvents (struct soap *soap,
|
|||
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].hidden = (Event.HiddenOrVisible == HidVis_HIDDEN) ? 1 :
|
||||
0;
|
||||
Gbl.Usrs.Other.UsrDat.UsrCod = Event.UsrCod;
|
||||
if (API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Gbl.Hierarchy.Crs.CrsCod)) // Get some user's data from database
|
||||
if (API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Gbl.Hierarchy.Crs.Cod)) // Get some user's data from database
|
||||
{
|
||||
Length = strlen (Gbl.Usrs.Other.UsrDat.Surname1);
|
||||
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].userSurname1 =
|
||||
|
@ -2434,7 +2434,7 @@ int swad__sendAttendanceEvent (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_sendAttendanceEvent;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
|
||||
/***** Check web service key *****/
|
||||
if ((ReturnCode = API_CheckAPIKey (wsKey)) != SOAP_OK)
|
||||
|
@ -2445,13 +2445,13 @@ int swad__sendAttendanceEvent (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** Check if course code is correct *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
|
||||
if (Gbl.Hierarchy.Crs.Cod <= 0)
|
||||
return soap_sender_fault (soap,
|
||||
"Bad course code",
|
||||
"Course code must be a integer greater than 0");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -2555,7 +2555,7 @@ int swad__removeAttendanceEvent (struct soap *soap,
|
|||
if (Event.AttCod > 0) // The event already exists
|
||||
{
|
||||
Att_GetEventDataByCod (&Event);
|
||||
Gbl.Hierarchy.Crs.CrsCod = Event.CrsCod;
|
||||
Gbl.Hierarchy.Crs.Cod = Event.CrsCod;
|
||||
}
|
||||
else
|
||||
return soap_receiver_fault (soap,
|
||||
|
@ -2563,13 +2563,13 @@ int swad__removeAttendanceEvent (struct soap *soap,
|
|||
"Attendance event does not exist");
|
||||
|
||||
/***** Check if course code is correct *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
|
||||
if (Gbl.Hierarchy.Crs.Cod <= 0)
|
||||
return soap_sender_fault (soap,
|
||||
"Bad course code",
|
||||
"Course code must be a integer greater than 0");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -2623,7 +2623,7 @@ static void API_GetLstGrpsSel (const char *Groups)
|
|||
{
|
||||
Str_GetNextStringUntilComma (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
Gbl.Crs.Grps.LstGrpsSel.GrpCods[NumGrp] = Str_ConvertStrCodToLongCod (LongStr);
|
||||
if (Grp_DB_CheckIfGrpBelongsToCrs (Gbl.Crs.Grps.LstGrpsSel.GrpCods[NumGrp],Gbl.Hierarchy.Crs.CrsCod))
|
||||
if (Grp_DB_CheckIfGrpBelongsToCrs (Gbl.Crs.Grps.LstGrpsSel.GrpCods[NumGrp],Gbl.Hierarchy.Crs.Cod))
|
||||
NumGrp++;
|
||||
}
|
||||
Gbl.Crs.Grps.LstGrpsSel.NumGrps = NumGrp; // Update number of groups
|
||||
|
@ -2663,10 +2663,10 @@ int swad__getAttendanceUsers (struct soap *soap,
|
|||
/***** Get course of this attendance event *****/
|
||||
Event.AttCod = (long) attendanceEventCode;
|
||||
Att_GetEventDataByCod (&Event);
|
||||
Gbl.Hierarchy.Crs.CrsCod = Event.CrsCod;
|
||||
Gbl.Hierarchy.Crs.Cod = Event.CrsCod;
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -2811,10 +2811,10 @@ int swad__sendAttendanceUsers (struct soap *soap,
|
|||
Event.AttCod = (long) attendanceEventCode;
|
||||
if (!Att_GetEventDataByCod (&Event))
|
||||
return SOAP_OK; // return with success = 0
|
||||
Gbl.Hierarchy.Crs.CrsCod = Event.CrsCod;
|
||||
Gbl.Hierarchy.Crs.Cod = Event.CrsCod;
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -2929,13 +2929,13 @@ int swad__getNotifications (struct soap *soap,
|
|||
getNotificationsOut->notificationsArray.__ptr[NumNotif].eventTime = EventTime;
|
||||
|
||||
/* Get course (row[7]) */
|
||||
Hie.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[7]);
|
||||
Hie.Crs.Cod = Str_ConvertStrCodToLongCod (row[7]);
|
||||
Crs_GetCourseDataByCod (&Hie.Crs);
|
||||
|
||||
/* Get user's code of the user who caused the event (row[3]) */
|
||||
Gbl.Usrs.Other.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[3]);
|
||||
|
||||
if (API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Hie.Crs.CrsCod)) // Get some user's data from database
|
||||
if (API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Hie.Crs.Cod)) // Get some user's data from database
|
||||
{
|
||||
getNotificationsOut->notificationsArray.__ptr[NumNotif].userNickname =
|
||||
soap_malloc (soap,Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1);
|
||||
|
@ -2977,15 +2977,15 @@ int swad__getNotifications (struct soap *soap,
|
|||
}
|
||||
|
||||
/* Get institution (row[4]) */
|
||||
Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[4]);
|
||||
Hie.Ins.Cod = Str_ConvertStrCodToLongCod (row[4]);
|
||||
Ins_GetInstitDataByCod (&Hie.Ins);
|
||||
|
||||
/* Get center (row[5]) */
|
||||
Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[5]);
|
||||
Hie.Ctr.Cod = Str_ConvertStrCodToLongCod (row[5]);
|
||||
Ctr_GetCenterDataByCod (&Hie.Ctr);
|
||||
|
||||
/* Get degree (row[6]) */
|
||||
Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[6]);
|
||||
Hie.Deg.Cod = Str_ConvertStrCodToLongCod (row[6]);
|
||||
Deg_GetDegreeDataByCod (&Hie.Deg);
|
||||
|
||||
/* Get message/post/... code (row[8]) */
|
||||
|
@ -3005,16 +3005,16 @@ int swad__getNotifications (struct soap *soap,
|
|||
sprintf (getNotificationsOut->notificationsArray.__ptr[NumNotif].location,"%s: %s",
|
||||
Txt_Forum,ForumName);
|
||||
}
|
||||
else if (Hie.Crs.CrsCod > 0)
|
||||
else if (Hie.Crs.Cod > 0)
|
||||
sprintf (getNotificationsOut->notificationsArray.__ptr[NumNotif].location,"%s: %s",
|
||||
Txt_Course,Hie.Crs.ShrtName);
|
||||
else if (Hie.Deg.DegCod > 0)
|
||||
else if (Hie.Deg.Cod > 0)
|
||||
sprintf (getNotificationsOut->notificationsArray.__ptr[NumNotif].location,"%s: %s",
|
||||
Txt_Degree,Hie.Deg.ShrtName);
|
||||
else if (Hie.Ctr.CtrCod > 0)
|
||||
else if (Hie.Ctr.Cod > 0)
|
||||
sprintf (getNotificationsOut->notificationsArray.__ptr[NumNotif].location,"%s: %s",
|
||||
Txt_Center,Hie.Ctr.ShrtName);
|
||||
else if (Hie.Ins.InsCod > 0)
|
||||
else if (Hie.Ins.Cod > 0)
|
||||
sprintf (getNotificationsOut->notificationsArray.__ptr[NumNotif].location,"%s: %s",
|
||||
Txt_Institution,Hie.Ins.ShrtName);
|
||||
else
|
||||
|
@ -3029,7 +3029,7 @@ int swad__getNotifications (struct soap *soap,
|
|||
/* Get summary and content */
|
||||
ContentStr = NULL;
|
||||
Ntf_GetNotifSummaryAndContent (SummaryStr,&ContentStr,NotifyEvent,
|
||||
Cod,Hie.Crs.CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
Cod,Hie.Crs.Cod,Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
true);
|
||||
|
||||
Length = strlen (SummaryStr);
|
||||
|
@ -3337,7 +3337,7 @@ int swad__sendNotice (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_sendNotice;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
|
||||
/***** Check web service key *****/
|
||||
if ((ReturnCode = API_CheckAPIKey (wsKey)) != SOAP_OK)
|
||||
|
@ -3348,7 +3348,7 @@ int swad__sendNotice (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -3357,12 +3357,12 @@ int swad__sendNotice (struct soap *soap,
|
|||
|
||||
/***** Check course and group codes *****/
|
||||
if ((ReturnCode = API_CheckCourseAndGroupCodes (soap,
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Gbl.Hierarchy.Crs.Cod,
|
||||
-1L)) != SOAP_OK)
|
||||
return ReturnCode;
|
||||
|
||||
/***** Get degree of current course *****/
|
||||
Gbl.Hierarchy.Deg.DegCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
Gbl.Hierarchy.Deg.Cod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
|
||||
/***** Check if I am a teacher *****/
|
||||
if (Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs != Rol_TCH)
|
||||
|
@ -3399,7 +3399,7 @@ int swad__getTestConfig (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_getTestConfig;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
|
||||
/***** Check web service key *****/
|
||||
if ((ReturnCode = API_CheckAPIKey (wsKey)) != SOAP_OK)
|
||||
|
@ -3410,7 +3410,7 @@ int swad__getTestConfig (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -3418,7 +3418,7 @@ int swad__getTestConfig (struct soap *soap,
|
|||
Gbl.Usrs.Me.Role.Logged = Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs;
|
||||
|
||||
/***** Check if course code is correct *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
|
||||
if (Gbl.Hierarchy.Crs.Cod <= 0)
|
||||
return soap_sender_fault (soap,
|
||||
"Bad course code",
|
||||
"Course code must be a integer greater than 0");
|
||||
|
@ -3432,7 +3432,7 @@ int swad__getTestConfig (struct soap *soap,
|
|||
"Requester must belong to course");
|
||||
|
||||
/***** Get degree of current course *****/
|
||||
Gbl.Hierarchy.Deg.DegCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
Gbl.Hierarchy.Deg.Cod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
|
||||
/***** Set default result to empty *****/
|
||||
getTestConfigOut->numQuestions =
|
||||
|
@ -3493,7 +3493,7 @@ int swad__getTests (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_getTests;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
|
||||
/***** Check web service key *****/
|
||||
if ((ReturnCode = API_CheckAPIKey (wsKey)) != SOAP_OK)
|
||||
|
@ -3504,7 +3504,7 @@ int swad__getTests (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -3512,7 +3512,7 @@ int swad__getTests (struct soap *soap,
|
|||
Gbl.Usrs.Me.Role.Logged = Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs;
|
||||
|
||||
/***** Check if course code is correct *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
|
||||
if (Gbl.Hierarchy.Crs.Cod <= 0)
|
||||
return soap_sender_fault (soap,
|
||||
"Bad course code",
|
||||
"Course code must be a integer greater than 0");
|
||||
|
@ -3526,7 +3526,7 @@ int swad__getTests (struct soap *soap,
|
|||
"Requester must belong to course");
|
||||
|
||||
/***** Get degree of current course *****/
|
||||
Gbl.Hierarchy.Deg.DegCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
Gbl.Hierarchy.Deg.Cod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
|
||||
/***** Set default result to empty *****/
|
||||
getTestsOut->tagsArray.__size = 0;
|
||||
|
@ -3846,7 +3846,7 @@ int swad__getTrivialQuestion (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -4029,7 +4029,7 @@ int swad__getGames (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_getGames;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
|
||||
/***** Check web service key *****/
|
||||
if ((ReturnCode = API_CheckAPIKey (wsKey)) != SOAP_OK)
|
||||
|
@ -4040,13 +4040,13 @@ int swad__getGames (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** Check if course code is correct *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
|
||||
if (Gbl.Hierarchy.Crs.Cod <= 0)
|
||||
return soap_sender_fault (soap,
|
||||
"Bad course code",
|
||||
"Course code must be a integer greater than 0");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -4085,7 +4085,7 @@ int swad__getGames (struct soap *soap,
|
|||
|
||||
/* Get user's code of the user who created the game (row[1]) */
|
||||
Gbl.Usrs.Other.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
if (API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Gbl.Hierarchy.Crs.CrsCod)) // Get some user's data from database
|
||||
if (API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Gbl.Hierarchy.Crs.Cod)) // Get some user's data from database
|
||||
{
|
||||
Length = strlen (Gbl.Usrs.Other.UsrDat.Surname1);
|
||||
getGamesOut->gamesArray.__ptr[NumGame].userSurname1 =
|
||||
|
@ -4183,7 +4183,7 @@ int swad__getMatches (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_getMatches;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
|
||||
/***** Check web service key *****/
|
||||
if ((ReturnCode = API_CheckAPIKey (wsKey)) != SOAP_OK)
|
||||
|
@ -4194,7 +4194,7 @@ int swad__getMatches (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** Check if course code is correct *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
|
||||
if (Gbl.Hierarchy.Crs.Cod <= 0)
|
||||
return soap_sender_fault (soap,
|
||||
"Bad course code",
|
||||
"Course code must be a integer greater than 0");
|
||||
|
@ -4211,7 +4211,7 @@ int swad__getMatches (struct soap *soap,
|
|||
Gam_GetGameDataByCod (&Game);
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -4250,7 +4250,7 @@ int swad__getMatches (struct soap *soap,
|
|||
|
||||
/* Get user's code of the user who created the game (row[1]) */
|
||||
Gbl.Usrs.Other.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
if (API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Gbl.Hierarchy.Crs.CrsCod)) // Get some user's data from database
|
||||
if (API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Gbl.Hierarchy.Crs.Cod)) // Get some user's data from database
|
||||
{
|
||||
Length = strlen (Gbl.Usrs.Other.UsrDat.Surname1);
|
||||
getMatchesOut->matchesArray.__ptr[NumMatch].userSurname1 =
|
||||
|
@ -4340,7 +4340,7 @@ int swad__getMatchStatus (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_getMatchStatus;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
Game.GamCod = (long) gameCode;
|
||||
Match.MchCod = (long) matchCode;
|
||||
|
||||
|
@ -4359,7 +4359,7 @@ int swad__getMatchStatus (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** Check if course code is correct *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
|
||||
if (Gbl.Hierarchy.Crs.Cod <= 0)
|
||||
return soap_sender_fault (soap,
|
||||
"Bad course code",
|
||||
"Course code must be a integer greater than 0");
|
||||
|
@ -4385,7 +4385,7 @@ int swad__getMatchStatus (struct soap *soap,
|
|||
"Match does not belong to game");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -4463,7 +4463,7 @@ int swad__answerMatchQuestion (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_answerMatchQuestion;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
Game.GamCod = (long) gameCode;
|
||||
Match.MchCod = (long) matchCode;
|
||||
|
||||
|
@ -4481,7 +4481,7 @@ int swad__answerMatchQuestion (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** Check if course code is correct *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
|
||||
if (Gbl.Hierarchy.Crs.Cod <= 0)
|
||||
return soap_sender_fault (soap,
|
||||
"Bad course code",
|
||||
"Course code must be a integer greater than 0");
|
||||
|
@ -4592,7 +4592,7 @@ int swad__getDirectoryTree (struct soap *soap,
|
|||
/***** Initializations *****/
|
||||
API_Set_gSOAP_RuntimeEnv (soap);
|
||||
Gbl.WebService.Function = API_getDirectoryTree;
|
||||
Gbl.Hierarchy.Crs.CrsCod = (long) courseCode;
|
||||
Gbl.Hierarchy.Crs.Cod = (long) courseCode;
|
||||
Gbl.Crs.Grps.GrpCod = (long) groupCode;
|
||||
|
||||
/***** Check web service key *****/
|
||||
|
@ -4603,7 +4603,7 @@ int swad__getDirectoryTree (struct soap *soap,
|
|||
"Bad web service key",
|
||||
"Web service key does not exist in database");
|
||||
|
||||
if (!API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Me.UsrDat,Gbl.Hierarchy.Crs.CrsCod))
|
||||
if (!API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Me.UsrDat,Gbl.Hierarchy.Crs.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -4612,7 +4612,7 @@ int swad__getDirectoryTree (struct soap *soap,
|
|||
|
||||
/***** Check course and group codes *****/
|
||||
if ((ReturnCode = API_CheckCourseAndGroupCodes (soap,
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Gbl.Hierarchy.Crs.Cod,
|
||||
Gbl.Crs.Grps.GrpCod)) != SOAP_OK)
|
||||
return ReturnCode;
|
||||
|
||||
|
@ -4674,13 +4674,13 @@ int swad__getDirectoryTree (struct soap *soap,
|
|||
"Course code must be a integer greater than 0");
|
||||
|
||||
/* Initialize path to private directory */
|
||||
Gbl.Hierarchy.Crs.CrsCod = (courseCode > 0) ? (long) courseCode :
|
||||
Gbl.Hierarchy.Crs.Cod = (courseCode > 0) ? (long) courseCode :
|
||||
-1L;
|
||||
Gbl.Crs.Grps.GrpCod = (groupCode > 0) ? (long) groupCode :
|
||||
-1L;
|
||||
|
||||
snprintf (Gbl.Crs.PathPriv,sizeof (Gbl.Crs.PathPriv),"%s/%ld",
|
||||
Cfg_PATH_CRS_PRIVATE,Gbl.Hierarchy.Crs.CrsCod);
|
||||
Cfg_PATH_CRS_PRIVATE,Gbl.Hierarchy.Crs.Cod);
|
||||
Brw_InitializeFileBrowser ();
|
||||
Str_Copy (Gbl.FileBrowser.FilFolLnk.Path,Brw_RootFolderInternalNames[Gbl.FileBrowser.Type],
|
||||
sizeof (Gbl.FileBrowser.FilFolLnk.Path) - 1);
|
||||
|
@ -4936,15 +4936,15 @@ int swad__getFile (struct soap *soap,
|
|||
|
||||
/***** Set course and group codes *****/
|
||||
Brw_GetCrsGrpFromFileMetadata (FileMetadata.FileBrowser,FileMetadata.Cod,
|
||||
&Gbl.Hierarchy.Ins.InsCod,
|
||||
&Gbl.Hierarchy.Ctr.CtrCod,
|
||||
&Gbl.Hierarchy.Deg.DegCod,
|
||||
&Gbl.Hierarchy.Crs.CrsCod,
|
||||
&Gbl.Hierarchy.Ins.Cod,
|
||||
&Gbl.Hierarchy.Ctr.Cod,
|
||||
&Gbl.Hierarchy.Deg.Cod,
|
||||
&Gbl.Hierarchy.Crs.Cod,
|
||||
&Gbl.Crs.Grps.GrpCod);
|
||||
Hie_InitHierarchy ();
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -4953,7 +4953,7 @@ int swad__getFile (struct soap *soap,
|
|||
|
||||
/***** Check course and group codes *****/
|
||||
if ((ReturnCode = API_CheckCourseAndGroupCodes (soap,
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Gbl.Hierarchy.Crs.Cod,
|
||||
Gbl.Crs.Grps.GrpCod)) != SOAP_OK)
|
||||
return ReturnCode;
|
||||
|
||||
|
@ -5084,20 +5084,20 @@ int swad__getMarks (struct soap *soap,
|
|||
|
||||
/***** Set course and group codes *****/
|
||||
Brw_GetCrsGrpFromFileMetadata (FileMetadata.FileBrowser,FileMetadata.Cod,
|
||||
&Gbl.Hierarchy.Ins.InsCod,
|
||||
&Gbl.Hierarchy.Ctr.CtrCod,
|
||||
&Gbl.Hierarchy.Deg.DegCod,
|
||||
&Gbl.Hierarchy.Crs.CrsCod,
|
||||
&Gbl.Hierarchy.Ins.Cod,
|
||||
&Gbl.Hierarchy.Ctr.Cod,
|
||||
&Gbl.Hierarchy.Deg.Cod,
|
||||
&Gbl.Hierarchy.Crs.Cod,
|
||||
&Gbl.Crs.Grps.GrpCod);
|
||||
|
||||
/***** Check course and group codes *****/
|
||||
if ((ReturnCode = API_CheckCourseAndGroupCodes (soap,
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Gbl.Hierarchy.Crs.Cod,
|
||||
Gbl.Crs.Grps.GrpCod)) != SOAP_OK)
|
||||
return ReturnCode;
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -5167,7 +5167,7 @@ int swad__getLocation (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
@ -5218,7 +5218,7 @@ int swad__sendMyLocation (struct soap *soap,
|
|||
"Web service key does not exist in database");
|
||||
|
||||
/***** 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.Cod))
|
||||
return soap_receiver_fault (soap,
|
||||
"Can not get user's data from database",
|
||||
"User does not exist in database");
|
||||
|
|
|
@ -185,7 +185,7 @@ void QR_ExamAnnnouncement (void)
|
|||
|
||||
if (asprintf (&URL,"https://chart.googleapis.com/chart?cht=qr&chs=%ux%u&chl=%s/?crs=%ld%%26act=%ld",
|
||||
300,300,
|
||||
Cfg_URL_SWAD_CGI,Gbl.Hierarchy.Crs.CrsCod,
|
||||
Cfg_URL_SWAD_CGI,Gbl.Hierarchy.Crs.Cod,
|
||||
Act_GetActCod (ActSeeAllCfe)) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
HTM_IMG (URL,NULL,Txt_Link_to_call_for_exam,
|
||||
|
|
18
swad_RSS.c
18
swad_RSS.c
|
@ -61,7 +61,7 @@ void RSS_UpdateRSSFileForACrs (struct Crs_Course *Crs)
|
|||
|
||||
/***** Create RSS directory if not exists *****/
|
||||
snprintf (PathRelPublRSSDir,sizeof (PathRelPublRSSDir),"%s/%ld/%s",
|
||||
Cfg_PATH_CRS_PUBLIC,Crs->CrsCod,Cfg_RSS_FOLDER);
|
||||
Cfg_PATH_CRS_PUBLIC,Crs->Cod,Cfg_RSS_FOLDER);
|
||||
Fil_CreateDirIfNotExists (PathRelPublRSSDir);
|
||||
|
||||
/***** Create RSS file *****/
|
||||
|
@ -78,14 +78,14 @@ void RSS_UpdateRSSFileForACrs (struct Crs_Course *Crs)
|
|||
fprintf (FileRSS,"<channel>\n");
|
||||
|
||||
fprintf (FileRSS,"<atom:link href=\"");
|
||||
RSS_BuildRSSLink (RSSLink,Crs->CrsCod);
|
||||
RSS_BuildRSSLink (RSSLink,Crs->Cod);
|
||||
fprintf (FileRSS,"%s",RSSLink);
|
||||
fprintf (FileRSS,"\" rel=\"self\" type=\"application/rss+xml\" />\n");
|
||||
|
||||
fprintf (FileRSS,"<title>%s: %s</title>\n",
|
||||
Cfg_PLATFORM_SHORT_NAME,Crs->ShrtName);
|
||||
fprintf (FileRSS,"<link>%s/?crs=%ld</link>\n",
|
||||
Cfg_URL_SWAD_CGI,Crs->CrsCod);
|
||||
Cfg_URL_SWAD_CGI,Crs->Cod);
|
||||
fprintf (FileRSS,"<description>%s</description>\n",
|
||||
Crs->FullName);
|
||||
fprintf (FileRSS,"<language>%s</language>\n",
|
||||
|
@ -99,7 +99,7 @@ void RSS_UpdateRSSFileForACrs (struct Crs_Course *Crs)
|
|||
fprintf (FileRSS,"<title>%s: %s</title>\n",
|
||||
Cfg_PLATFORM_SHORT_NAME,Crs->ShrtName);
|
||||
fprintf (FileRSS,"<link>%s/?crs=%ld</link>\n",
|
||||
Cfg_URL_SWAD_CGI,Crs->CrsCod);
|
||||
Cfg_URL_SWAD_CGI,Crs->Cod);
|
||||
fprintf (FileRSS,"<width>112</width>\n"
|
||||
"<height>32</height>\n"
|
||||
"</image>\n");
|
||||
|
@ -153,7 +153,7 @@ static void RSS_WriteNotices (FILE *FileRSS,struct Crs_Course *Crs)
|
|||
char Content[Cns_MAX_BYTES_TEXT + 1];
|
||||
|
||||
/***** Write items with active notices *****/
|
||||
if ((NumNotices = Not_DB_GetActiveNotices (&mysql_res,Crs->CrsCod)))
|
||||
if ((NumNotices = Not_DB_GetActiveNotices (&mysql_res,Crs->Cod)))
|
||||
{
|
||||
Usr_UsrDataConstructor (&UsrDat);
|
||||
|
||||
|
@ -191,7 +191,7 @@ static void RSS_WriteNotices (FILE *FileRSS,struct Crs_Course *Crs)
|
|||
|
||||
/* Write link to the notice */
|
||||
fprintf (FileRSS,"<link>%s/?crs=%ld</link>\n",
|
||||
Cfg_URL_SWAD_CGI,Crs->CrsCod);
|
||||
Cfg_URL_SWAD_CGI,Crs->Cod);
|
||||
|
||||
/* Write full content of the notice */
|
||||
Str_Copy (Content,row[3],sizeof (Content) - 1);
|
||||
|
@ -206,7 +206,7 @@ static void RSS_WriteNotices (FILE *FileRSS,struct Crs_Course *Crs)
|
|||
|
||||
/* Write unique string for this item */
|
||||
fprintf (FileRSS,"<guid isPermaLink=\"false\">%s, course #%ld, notice #%ld</guid>\n",
|
||||
Cfg_URL_SWAD_CGI,Crs->CrsCod,NotCod);
|
||||
Cfg_URL_SWAD_CGI,Crs->Cod,NotCod);
|
||||
|
||||
/* Write publication date */
|
||||
fprintf (FileRSS,"<pubDate>");
|
||||
|
@ -271,7 +271,7 @@ static void RSS_WriteCallsForExams (FILE *FileRSS,struct Crs_Course *Crs)
|
|||
|
||||
/* Write link to the notice */
|
||||
fprintf (FileRSS,"<link>%s/?crs=%ld</link>\n",
|
||||
Cfg_URL_SWAD_CGI,Crs->CrsCod);
|
||||
Cfg_URL_SWAD_CGI,Crs->Cod);
|
||||
|
||||
/* Write full content of the exam announcement (row[2]) */
|
||||
fprintf (FileRSS,"<description><![CDATA[<p><em>Fecha examen: %s</em></p>]]></description>\n", // TODO: Need translation!
|
||||
|
@ -279,7 +279,7 @@ static void RSS_WriteCallsForExams (FILE *FileRSS,struct Crs_Course *Crs)
|
|||
|
||||
/* Write unique string for this item */
|
||||
fprintf (FileRSS,"<guid isPermaLink=\"false\">%s, course #%ld, exam #%ld</guid>\n",
|
||||
Cfg_URL_SWAD_CGI,Crs->CrsCod,ExaCod);
|
||||
Cfg_URL_SWAD_CGI,Crs->Cod,ExaCod);
|
||||
|
||||
/* Write publication date */
|
||||
fprintf (FileRSS,"<pubDate>");
|
||||
|
|
24
swad_admin.c
24
swad_admin.c
|
@ -81,7 +81,7 @@ static void Adm_EffectivelyRemAdm (struct Usr_Data *UsrDat,
|
|||
|
||||
void Adm_ReqAddAdmOfIns (void)
|
||||
{
|
||||
Adm_ReqAddAdm (HieLvl_INS,Gbl.Hierarchy.Ins.InsCod,Gbl.Hierarchy.Ins.FullName);
|
||||
Adm_ReqAddAdm (HieLvl_INS,Gbl.Hierarchy.Ins.Cod,Gbl.Hierarchy.Ins.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -90,7 +90,7 @@ void Adm_ReqAddAdmOfIns (void)
|
|||
|
||||
void Adm_ReqAddAdmOfCtr (void)
|
||||
{
|
||||
Adm_ReqAddAdm (HieLvl_CTR,Gbl.Hierarchy.Ctr.CtrCod,Gbl.Hierarchy.Ctr.FullName);
|
||||
Adm_ReqAddAdm (HieLvl_CTR,Gbl.Hierarchy.Ctr.Cod,Gbl.Hierarchy.Ctr.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -99,7 +99,7 @@ void Adm_ReqAddAdmOfCtr (void)
|
|||
|
||||
void Adm_ReqAddAdmOfDeg (void)
|
||||
{
|
||||
Adm_ReqAddAdm (HieLvl_DEG,Gbl.Hierarchy.Deg.DegCod,Gbl.Hierarchy.Deg.FullName);
|
||||
Adm_ReqAddAdm (HieLvl_DEG,Gbl.Hierarchy.Deg.Cod,Gbl.Hierarchy.Deg.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -171,7 +171,7 @@ static void Adm_ReqAddAdm (HieLvl_Level_t Level,long Cod,
|
|||
|
||||
void Adm_AddAdmToIns (void)
|
||||
{
|
||||
Adm_AddAdm (HieLvl_INS,Gbl.Hierarchy.Ins.InsCod,Gbl.Hierarchy.Ins.FullName);
|
||||
Adm_AddAdm (HieLvl_INS,Gbl.Hierarchy.Ins.Cod,Gbl.Hierarchy.Ins.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -180,7 +180,7 @@ void Adm_AddAdmToIns (void)
|
|||
|
||||
void Adm_AddAdmToCtr (void)
|
||||
{
|
||||
Adm_AddAdm (HieLvl_CTR,Gbl.Hierarchy.Ctr.CtrCod,Gbl.Hierarchy.Ctr.FullName);
|
||||
Adm_AddAdm (HieLvl_CTR,Gbl.Hierarchy.Ctr.Cod,Gbl.Hierarchy.Ctr.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -189,7 +189,7 @@ void Adm_AddAdmToCtr (void)
|
|||
|
||||
void Adm_AddAdmToDeg (void)
|
||||
{
|
||||
Adm_AddAdm (HieLvl_DEG,Gbl.Hierarchy.Deg.DegCod,Gbl.Hierarchy.Deg.FullName);
|
||||
Adm_AddAdm (HieLvl_DEG,Gbl.Hierarchy.Deg.Cod,Gbl.Hierarchy.Deg.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -277,7 +277,7 @@ static void Adm_RegisterAdmin (struct Usr_Data *UsrDat,
|
|||
void Adm_ReqRemAdmOfIns (void)
|
||||
{
|
||||
Adm_ReqRemOrRemAdm (Enr_REQUEST_REMOVE_USR,HieLvl_INS,
|
||||
Gbl.Hierarchy.Ins.InsCod,Gbl.Hierarchy.Ins.FullName);
|
||||
Gbl.Hierarchy.Ins.Cod,Gbl.Hierarchy.Ins.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -287,7 +287,7 @@ void Adm_ReqRemAdmOfIns (void)
|
|||
void Adm_ReqRemAdmOfCtr (void)
|
||||
{
|
||||
Adm_ReqRemOrRemAdm (Enr_REQUEST_REMOVE_USR,HieLvl_CTR,
|
||||
Gbl.Hierarchy.Ctr.CtrCod,Gbl.Hierarchy.Ctr.FullName);
|
||||
Gbl.Hierarchy.Ctr.Cod,Gbl.Hierarchy.Ctr.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -297,7 +297,7 @@ void Adm_ReqRemAdmOfCtr (void)
|
|||
void Adm_ReqRemAdmOfDeg (void)
|
||||
{
|
||||
Adm_ReqRemOrRemAdm (Enr_REQUEST_REMOVE_USR,HieLvl_DEG,
|
||||
Gbl.Hierarchy.Deg.DegCod,Gbl.Hierarchy.Deg.FullName);
|
||||
Gbl.Hierarchy.Deg.Cod,Gbl.Hierarchy.Deg.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -307,7 +307,7 @@ void Adm_ReqRemAdmOfDeg (void)
|
|||
void Adm_RemAdmIns (void)
|
||||
{
|
||||
Adm_ReqRemOrRemAdm (Enr_REMOVE_USR,HieLvl_INS,
|
||||
Gbl.Hierarchy.Ins.InsCod,Gbl.Hierarchy.Ins.FullName);
|
||||
Gbl.Hierarchy.Ins.Cod,Gbl.Hierarchy.Ins.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -317,7 +317,7 @@ void Adm_RemAdmIns (void)
|
|||
void Adm_RemAdmCtr (void)
|
||||
{
|
||||
Adm_ReqRemOrRemAdm (Enr_REMOVE_USR,HieLvl_CTR,
|
||||
Gbl.Hierarchy.Ctr.CtrCod,Gbl.Hierarchy.Ctr.FullName);
|
||||
Gbl.Hierarchy.Ctr.Cod,Gbl.Hierarchy.Ctr.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -327,7 +327,7 @@ void Adm_RemAdmCtr (void)
|
|||
void Adm_RemAdmDeg (void)
|
||||
{
|
||||
Adm_ReqRemOrRemAdm (Enr_REMOVE_USR,HieLvl_DEG,
|
||||
Gbl.Hierarchy.Deg.DegCod,Gbl.Hierarchy.Deg.FullName);
|
||||
Gbl.Hierarchy.Deg.Cod,Gbl.Hierarchy.Deg.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -69,9 +69,9 @@ unsigned Adm_DB_GetAdmsCurrentScopeExceptMe (MYSQL_RES **mysql_res)
|
|||
" OR (Scope='%s' AND Cod=%ld))"
|
||||
" AND UsrCod<>%ld",
|
||||
Hie_GetDBStrFromLevel (HieLvl_SYS),
|
||||
Hie_GetDBStrFromLevel (HieLvl_INS),Gbl.Hierarchy.Ins.InsCod,
|
||||
Hie_GetDBStrFromLevel (HieLvl_CTR),Gbl.Hierarchy.Ctr.CtrCod,
|
||||
Hie_GetDBStrFromLevel (HieLvl_DEG),Gbl.Hierarchy.Deg.DegCod,
|
||||
Hie_GetDBStrFromLevel (HieLvl_INS),Gbl.Hierarchy.Ins.Cod,
|
||||
Hie_GetDBStrFromLevel (HieLvl_CTR),Gbl.Hierarchy.Ctr.Cod,
|
||||
Hie_GetDBStrFromLevel (HieLvl_DEG),Gbl.Hierarchy.Deg.Cod,
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
}
|
||||
|
||||
|
|
|
@ -374,7 +374,7 @@ unsigned Agd_DB_GetNumUsrsWithEvents (HieLvl_Level_t Level)
|
|||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=crs_users.CrsCod"
|
||||
" AND crs_users.UsrCod=agd_agendas.UsrCod",
|
||||
Gbl.Hierarchy.Cty.CtyCod);
|
||||
Gbl.Hierarchy.Cty.Cod);
|
||||
case HieLvl_INS:
|
||||
return (unsigned)
|
||||
DB_QueryCOUNT ("can not get number of users with events",
|
||||
|
@ -389,7 +389,7 @@ unsigned Agd_DB_GetNumUsrsWithEvents (HieLvl_Level_t Level)
|
|||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=crs_users.CrsCod"
|
||||
" AND crs_users.UsrCod=agd_agendas.UsrCod",
|
||||
Gbl.Hierarchy.Ins.InsCod);
|
||||
Gbl.Hierarchy.Ins.Cod);
|
||||
case HieLvl_CTR:
|
||||
return (unsigned)
|
||||
DB_QueryCOUNT ("can not get number of users with events",
|
||||
|
@ -402,7 +402,7 @@ unsigned Agd_DB_GetNumUsrsWithEvents (HieLvl_Level_t Level)
|
|||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=crs_users.CrsCod"
|
||||
" AND crs_users.UsrCod=agd_agendas.UsrCod",
|
||||
Gbl.Hierarchy.Ctr.CtrCod);
|
||||
Gbl.Hierarchy.Ctr.Cod);
|
||||
case HieLvl_DEG:
|
||||
return (unsigned)
|
||||
DB_QueryCOUNT ("can not get number of users with events",
|
||||
|
@ -413,7 +413,7 @@ unsigned Agd_DB_GetNumUsrsWithEvents (HieLvl_Level_t Level)
|
|||
" WHERE crs_courses.DegCod=%ld"
|
||||
" AND crs_courses.CrsCod=crs_users.CrsCod"
|
||||
" AND crs_users.UsrCod=agd_agendas.UsrCod",
|
||||
Gbl.Hierarchy.Deg.DegCod);
|
||||
Gbl.Hierarchy.Deg.Cod);
|
||||
case HieLvl_CRS:
|
||||
return (unsigned)
|
||||
DB_QueryCOUNT ("can not get number of users with events",
|
||||
|
@ -422,7 +422,7 @@ unsigned Agd_DB_GetNumUsrsWithEvents (HieLvl_Level_t Level)
|
|||
"agd_agendas"
|
||||
" WHERE crs_users.CrsCod=%ld"
|
||||
" AND crs_users.UsrCod=agd_agendas.UsrCod",
|
||||
Gbl.Hierarchy.Crs.CrsCod);
|
||||
Gbl.Hierarchy.Crs.Cod);
|
||||
default:
|
||||
Err_WrongHierarchyLevelExit ();
|
||||
return 0; // Not reached
|
||||
|
@ -463,7 +463,7 @@ unsigned Agd_DB_GetNumEvents (HieLvl_Level_t Level)
|
|||
" AND crs_courses.CrsCod=crs_users.CrsCod) AS users,"
|
||||
"agd_agendas"
|
||||
" WHERE users.UsrCod=agd_agendas.UsrCod",
|
||||
Gbl.Hierarchy.Cty.CtyCod);
|
||||
Gbl.Hierarchy.Cty.Cod);
|
||||
case HieLvl_INS:
|
||||
return (unsigned)
|
||||
DB_QueryCOUNT ("can not get number of events",
|
||||
|
@ -480,7 +480,7 @@ unsigned Agd_DB_GetNumEvents (HieLvl_Level_t Level)
|
|||
" AND crs_courses.CrsCod=crs_users.CrsCod) AS users,"
|
||||
"agd_agendas"
|
||||
" WHERE users.UsrCod=agd_agendas.UsrCod",
|
||||
Gbl.Hierarchy.Ins.InsCod);
|
||||
Gbl.Hierarchy.Ins.Cod);
|
||||
case HieLvl_CTR:
|
||||
return (unsigned)
|
||||
DB_QueryCOUNT ("can not get number of events",
|
||||
|
@ -495,7 +495,7 @@ unsigned Agd_DB_GetNumEvents (HieLvl_Level_t Level)
|
|||
" AND crs_courses.CrsCod=crs_users.CrsCod) AS users,"
|
||||
"agd_agendas"
|
||||
" WHERE users.UsrCod=agd_agendas.UsrCod",
|
||||
Gbl.Hierarchy.Ctr.CtrCod);
|
||||
Gbl.Hierarchy.Ctr.Cod);
|
||||
case HieLvl_DEG:
|
||||
return (unsigned)
|
||||
DB_QueryCOUNT ("can not get number of events",
|
||||
|
@ -508,7 +508,7 @@ unsigned Agd_DB_GetNumEvents (HieLvl_Level_t Level)
|
|||
" AND crs_courses.CrsCod=crs_users.CrsCod) AS users,"
|
||||
"agd_agendas"
|
||||
" WHERE users.UsrCod=agd_agendas.UsrCod",
|
||||
Gbl.Hierarchy.Deg.DegCod);
|
||||
Gbl.Hierarchy.Deg.Cod);
|
||||
case HieLvl_CRS:
|
||||
return (unsigned)
|
||||
DB_QueryCOUNT ("can not get number of events",
|
||||
|
@ -517,7 +517,7 @@ unsigned Agd_DB_GetNumEvents (HieLvl_Level_t Level)
|
|||
"agd_agendas"
|
||||
" WHERE crs_users.CrsCod=%ld"
|
||||
" AND crs_users.UsrCod=agd_agendas.UsrCod",
|
||||
Gbl.Hierarchy.Crs.CrsCod);
|
||||
Gbl.Hierarchy.Crs.Cod);
|
||||
default:
|
||||
Err_WrongHierarchyLevelExit ();
|
||||
return 0; // Not reached
|
||||
|
|
|
@ -389,9 +389,9 @@ void Asg_PrintOneAssignment (void)
|
|||
|
||||
/***** Write header *****/
|
||||
Lay_WriteHeaderClassPhoto (true,false,
|
||||
Gbl.Hierarchy.Ins.InsCod,
|
||||
Gbl.Hierarchy.Deg.DegCod,
|
||||
Gbl.Hierarchy.Crs.CrsCod);
|
||||
Gbl.Hierarchy.Ins.Cod,
|
||||
Gbl.Hierarchy.Deg.Cod,
|
||||
Gbl.Hierarchy.Crs.Cod);
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWideMarginPadding (2);
|
||||
|
|
|
@ -108,7 +108,7 @@ unsigned Asg_DB_GetListAssignmentsMyGrps (MYSQL_RES **mysql_res,
|
|||
" AND asg_groups.GrpCod=grp_users.GrpCod)"
|
||||
")"
|
||||
" ORDER BY %s",
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Gbl.Hierarchy.Crs.Cod,
|
||||
Asg_DB_HiddenSubQuery[Gbl.Usrs.Me.Role.Logged],
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
Asg_DB_OrderSubQuery[SelectedOrder]);
|
||||
|
@ -127,7 +127,7 @@ unsigned Asg_DB_GetListAssignmentsAllGrps (MYSQL_RES **mysql_res,
|
|||
" FROM asg_assignments"
|
||||
" WHERE CrsCod=%ld%s"
|
||||
" ORDER BY %s",
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Gbl.Hierarchy.Crs.Cod,
|
||||
Asg_DB_HiddenSubQuery[Gbl.Usrs.Me.Role.Logged],
|
||||
Asg_DB_OrderSubQuery[SelectedOrder]);
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ unsigned Asg_DB_GetAssignmentDataByCod (MYSQL_RES **mysql_res,long AsgCod)
|
|||
" WHERE AsgCod=%ld"
|
||||
" AND CrsCod=%ld", // Extra check
|
||||
AsgCod,
|
||||
Gbl.Hierarchy.Crs.CrsCod);
|
||||
Gbl.Hierarchy.Crs.Cod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -175,7 +175,7 @@ unsigned Asg_DB_GetAssignmentDataByFolder (MYSQL_RES **mysql_res,
|
|||
" FROM asg_assignments"
|
||||
" WHERE CrsCod=%ld" // Extra check
|
||||
" AND Folder='%s'",
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Gbl.Hierarchy.Crs.Cod,
|
||||
Folder);
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ void Asg_DB_GetAssignmentTitleByCod (long AsgCod,char *Title,size_t TitleSize)
|
|||
" WHERE AsgCod=%ld"
|
||||