mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-12 19:54:05 +02:00
Version 14.32
This commit is contained in:
parent
8095c8e4a0
commit
1b643ab6a6
|
@ -96,9 +96,11 @@ static void Att_RegUsrInAttEventChangingComments (long AttCod,long UsrCod,bool P
|
||||||
static void Att_RemoveUsrFromAttEvent (long AttCod,long UsrCod);
|
static void Att_RemoveUsrFromAttEvent (long AttCod,long UsrCod);
|
||||||
|
|
||||||
static void Att_ListAttEventsWithStds (void);
|
static void Att_ListAttEventsWithStds (void);
|
||||||
static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat);
|
static void Att_ListStdsAttendanceTable (unsigned NumStdsInList,long *LstSelectedUsrCods);
|
||||||
static void Att_WriteTableHeadSeveralAttEvents (void);
|
static void Att_WriteTableHeadSeveralAttEvents (void);
|
||||||
static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *UsrDat);
|
static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *UsrDat);
|
||||||
|
static void Att_ListStdsWithAttEventsDetails (unsigned NumStdsInList,long *LstSelectedUsrCods);
|
||||||
|
static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************** List all the attendance events ***********************/
|
/********************** List all the attendance events ***********************/
|
||||||
|
@ -2638,17 +2640,13 @@ void Usr_ReqListAttendanceStdsCrs (void)
|
||||||
void Usr_ListAttendanceStdsCrs (void)
|
void Usr_ListAttendanceStdsCrs (void)
|
||||||
{
|
{
|
||||||
extern const char *The_ClassFormul[The_NUM_THEMES];
|
extern const char *The_ClassFormul[The_NUM_THEMES];
|
||||||
extern const char *Txt_Attendance;
|
|
||||||
extern const char *Txt_Number_of_students;
|
|
||||||
extern const char *Txt_Comments;
|
|
||||||
extern const char *Txt_You_must_select_one_ore_more_students;
|
extern const char *Txt_You_must_select_one_ore_more_students;
|
||||||
unsigned NumStd = 0;
|
|
||||||
unsigned NumStdsInList;
|
unsigned NumStdsInList;
|
||||||
|
unsigned NumStd;
|
||||||
long *LstSelectedUsrCods;
|
long *LstSelectedUsrCods;
|
||||||
|
unsigned NumAttEvent;
|
||||||
const char *Ptr;
|
const char *Ptr;
|
||||||
struct UsrData UsrDat;
|
struct UsrData UsrDat;
|
||||||
unsigned NumAttEvent;
|
|
||||||
unsigned Total;
|
|
||||||
|
|
||||||
/***** Get list of attendance events *****/
|
/***** Get list of attendance events *****/
|
||||||
Att_GetListAttEvents (Att_OLDEST_FIRST);
|
Att_GetListAttEvents (Att_OLDEST_FIRST);
|
||||||
|
@ -2679,12 +2677,16 @@ void Usr_ListAttendanceStdsCrs (void)
|
||||||
LstSelectedUsrCods[NumStd] = UsrDat.UsrCod;
|
LstSelectedUsrCods[NumStd] = UsrDat.UsrCod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***** Free memory used for user's data *****/
|
||||||
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
|
||||||
/***** Get number of students in each event *****/
|
/***** Get number of students in each event *****/
|
||||||
for (NumAttEvent = 0;
|
for (NumAttEvent = 0;
|
||||||
NumAttEvent < Gbl.AttEvents.Num;
|
NumAttEvent < Gbl.AttEvents.Num;
|
||||||
NumAttEvent++)
|
NumAttEvent++)
|
||||||
/* Get number of students in this event */
|
/* Get number of students in this event */
|
||||||
Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList = Att_GetNumStdsFromAListWhoAreInAttEvent (Gbl.AttEvents.Lst[NumAttEvent].AttCod,LstSelectedUsrCods,NumStdsInList);
|
Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList = Att_GetNumStdsFromAListWhoAreInAttEvent (Gbl.AttEvents.Lst[NumAttEvent].AttCod,
|
||||||
|
LstSelectedUsrCods,NumStdsInList);
|
||||||
|
|
||||||
/***** List those events that have students (without comments) *****/
|
/***** List those events that have students (without comments) *****/
|
||||||
Att_ListAttEventsWithStds ();
|
Att_ListAttEventsWithStds ();
|
||||||
|
@ -2692,77 +2694,11 @@ void Usr_ListAttendanceStdsCrs (void)
|
||||||
/***** Get my preference about photos in users' list for current course *****/
|
/***** Get my preference about photos in users' list for current course *****/
|
||||||
Usr_GetMyPrefAboutListWithPhotosFromDB ();
|
Usr_GetMyPrefAboutListWithPhotosFromDB ();
|
||||||
|
|
||||||
/***** Table head *****/
|
/***** Show table with attendances for every student in list *****/
|
||||||
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
Att_ListStdsAttendanceTable (NumStdsInList,LstSelectedUsrCods);
|
||||||
Lay_StartRoundFrameTable10 (NULL,2,Txt_Attendance);
|
|
||||||
else
|
|
||||||
Lay_StartSquareFrameTable (NULL,NULL,NULL,2);
|
|
||||||
Att_WriteTableHeadSeveralAttEvents ();
|
|
||||||
|
|
||||||
/***** List the students *****/
|
|
||||||
for (NumStd = 0;
|
|
||||||
NumStd < NumStdsInList;
|
|
||||||
NumStd++)
|
|
||||||
{
|
|
||||||
UsrDat.UsrCod = LstSelectedUsrCods[NumStd];
|
|
||||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get from the database the data of the student
|
|
||||||
{
|
|
||||||
UsrDat.Accepted = Usr_GetIfUserHasAcceptedEnrollmentInCurrentCrs (UsrDat.UsrCod);
|
|
||||||
Att_WriteRowStdSeveralAttEvents (NumStd,&UsrDat);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Last row with the total of students present in each event *****/
|
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
|
||||||
"<td colspan=\"%u\" align=\"right\" class=\"DAT_N\""
|
|
||||||
" style=\"border-style:solid none none none;border-width:1px;\">%s:</td>",
|
|
||||||
Gbl.Usrs.Listing.WithPhotos ? 4 :
|
|
||||||
3,
|
|
||||||
Txt_Number_of_students);
|
|
||||||
for (NumAttEvent = 0, Total = 0;
|
|
||||||
NumAttEvent < Gbl.AttEvents.Num;
|
|
||||||
NumAttEvent++)
|
|
||||||
if (Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList)
|
|
||||||
{
|
|
||||||
fprintf (Gbl.F.Out,"<td align=\"center\" class=\"DAT_N\""
|
|
||||||
" style=\"border-style:solid none none none;border-width:1px;\">%u</td>",
|
|
||||||
Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList);
|
|
||||||
Total += Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList;
|
|
||||||
}
|
|
||||||
fprintf (Gbl.F.Out,"<td align=\"right\" class=\"DAT_N\""
|
|
||||||
" style=\"border-style:solid none none none;border-width:1px;\">%u</td>"
|
|
||||||
"</tr>",
|
|
||||||
Total);
|
|
||||||
|
|
||||||
/***** Table end *****/
|
|
||||||
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
|
||||||
Lay_EndRoundFrameTable10 ();
|
|
||||||
else
|
|
||||||
Lay_EndSquareFrameTable ();
|
|
||||||
|
|
||||||
/***** List the students with details and comments *****/
|
/***** List the students with details and comments *****/
|
||||||
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
Att_ListStdsWithAttEventsDetails (NumStdsInList,LstSelectedUsrCods);
|
||||||
Lay_StartRoundFrameTable10 (NULL,2,Txt_Comments);
|
|
||||||
else
|
|
||||||
Lay_StartSquareFrameTable (NULL,NULL,NULL,2);
|
|
||||||
for (NumStd = 0;
|
|
||||||
NumStd < NumStdsInList;
|
|
||||||
NumStd++)
|
|
||||||
{
|
|
||||||
UsrDat.UsrCod = LstSelectedUsrCods[NumStd];
|
|
||||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get from the database the data of the student
|
|
||||||
{
|
|
||||||
UsrDat.Accepted = Usr_GetIfUserHasAcceptedEnrollmentInCurrentCrs (UsrDat.UsrCod);
|
|
||||||
Att_ListAttEventsForAStd (NumStd,&UsrDat);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
|
||||||
Lay_EndRoundFrameTable10 ();
|
|
||||||
else
|
|
||||||
Lay_EndSquareFrameTable ();
|
|
||||||
|
|
||||||
/***** Free memory used for user's data *****/
|
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
|
||||||
|
|
||||||
/***** Free list of user codes *****/
|
/***** Free list of user codes *****/
|
||||||
free ((void *) LstSelectedUsrCods);
|
free ((void *) LstSelectedUsrCods);
|
||||||
|
@ -2793,6 +2729,7 @@ static void Att_ListAttEventsWithStds (void)
|
||||||
extern const char *Txt_Absent;
|
extern const char *Txt_Absent;
|
||||||
extern const char *Txt_Student_comment;
|
extern const char *Txt_Student_comment;
|
||||||
extern const char *Txt_Teachers_comment;
|
extern const char *Txt_Teachers_comment;
|
||||||
|
const char *BgColor;
|
||||||
unsigned NumAttEvent;
|
unsigned NumAttEvent;
|
||||||
|
|
||||||
/***** Start frame *****/
|
/***** Start frame *****/
|
||||||
|
@ -2814,24 +2751,31 @@ static void Att_ListAttEventsWithStds (void)
|
||||||
NumAttEvent++)
|
NumAttEvent++)
|
||||||
if (Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList)
|
if (Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList)
|
||||||
{
|
{
|
||||||
|
BgColor = Gbl.ColorRows[Gbl.RowEvenOdd];
|
||||||
|
|
||||||
/***** Get data of the attendance event from database *****/
|
/***** Get data of the attendance event from database *****/
|
||||||
Att_GetDataOfAttEventByCodAndCheckCrs (&Gbl.AttEvents.Lst[NumAttEvent]);
|
Att_GetDataOfAttEventByCodAndCheckCrs (&Gbl.AttEvents.Lst[NumAttEvent]);
|
||||||
Att_GetNumStdsTotalWhoAreInAttEvent (&Gbl.AttEvents.Lst[NumAttEvent]);
|
Att_GetNumStdsTotalWhoAreInAttEvent (&Gbl.AttEvents.Lst[NumAttEvent]);
|
||||||
|
|
||||||
/***** Write a row for this event *****/
|
/***** Write a row for this event *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td align=\"right\" class=\"DAT\">%u:</td>"
|
"<td align=\"right\" bgcolor=\"%s\" class=\"DAT\">%u:</td>"
|
||||||
"<td align=\"left\" class=\"DAT\">%02u/%02u/%04u %02u:%02u h %s</td>"
|
"<td align=\"left\" bgcolor=\"%s\" class=\"DAT\">%02u/%02u/%04u %02u:%02u h %s</td>"
|
||||||
"<td align=\"right\" class=\"DAT\">%u</td>"
|
"<td align=\"right\" bgcolor=\"%s\" class=\"DAT\">%u</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
|
BgColor,
|
||||||
NumAttEvent + 1,
|
NumAttEvent + 1,
|
||||||
|
BgColor,
|
||||||
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Date.Day,
|
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Date.Day,
|
||||||
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Date.Month,
|
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Date.Month,
|
||||||
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Date.Year,
|
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Date.Year,
|
||||||
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Time.Hour,
|
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Time.Hour,
|
||||||
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Time.Minute,
|
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Time.Minute,
|
||||||
Gbl.AttEvents.Lst[NumAttEvent].Title,
|
Gbl.AttEvents.Lst[NumAttEvent].Title,
|
||||||
|
BgColor,
|
||||||
Gbl.AttEvents.Lst[NumAttEvent].NumStdsTotal);
|
Gbl.AttEvents.Lst[NumAttEvent].NumStdsTotal);
|
||||||
|
|
||||||
|
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** End frame *****/
|
/***** End frame *****/
|
||||||
|
@ -2842,10 +2786,243 @@ static void Att_ListAttEventsWithStds (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********** Write list of those attendance events that have students *********/
|
/*********** Show table with attendances for every student in list ***********/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Att_ListStdsAttendanceTable (unsigned NumStdsInList,long *LstSelectedUsrCods)
|
||||||
|
{
|
||||||
|
extern const char *Txt_Attendance;
|
||||||
|
extern const char *Txt_Number_of_students;
|
||||||
|
struct UsrData UsrDat;
|
||||||
|
unsigned NumStd;
|
||||||
|
unsigned NumAttEvent;
|
||||||
|
unsigned Total;
|
||||||
|
|
||||||
|
/***** Initialize structure with user's data *****/
|
||||||
|
Usr_UsrDataConstructor (&UsrDat);
|
||||||
|
|
||||||
|
/***** Start frame *****/
|
||||||
|
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
||||||
|
Lay_StartRoundFrameTable10 (NULL,2,Txt_Attendance);
|
||||||
|
else
|
||||||
|
Lay_StartSquareFrameTable (NULL,NULL,NULL,2);
|
||||||
|
Att_WriteTableHeadSeveralAttEvents ();
|
||||||
|
|
||||||
|
/***** List the students *****/
|
||||||
|
for (NumStd = 0;
|
||||||
|
NumStd < NumStdsInList;
|
||||||
|
NumStd++)
|
||||||
|
{
|
||||||
|
UsrDat.UsrCod = LstSelectedUsrCods[NumStd];
|
||||||
|
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get from the database the data of the student
|
||||||
|
{
|
||||||
|
UsrDat.Accepted = Usr_GetIfUserHasAcceptedEnrollmentInCurrentCrs (UsrDat.UsrCod);
|
||||||
|
Att_WriteRowStdSeveralAttEvents (NumStd,&UsrDat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Last row with the total of students present in each event *****/
|
||||||
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
"<td colspan=\"%u\" align=\"right\" class=\"DAT_N\""
|
||||||
|
" style=\"border-style:solid none none none;border-width:1px;\">%s:</td>",
|
||||||
|
Gbl.Usrs.Listing.WithPhotos ? 4 :
|
||||||
|
3,
|
||||||
|
Txt_Number_of_students);
|
||||||
|
for (NumAttEvent = 0, Total = 0;
|
||||||
|
NumAttEvent < Gbl.AttEvents.Num;
|
||||||
|
NumAttEvent++)
|
||||||
|
if (Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList)
|
||||||
|
{
|
||||||
|
fprintf (Gbl.F.Out,"<td align=\"center\" class=\"DAT_N\""
|
||||||
|
" style=\"border-style:solid none none none;border-width:1px;\">%u</td>",
|
||||||
|
Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList);
|
||||||
|
Total += Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList;
|
||||||
|
}
|
||||||
|
fprintf (Gbl.F.Out,"<td align=\"right\" class=\"DAT_N\""
|
||||||
|
" style=\"border-style:solid none none none;border-width:1px;\">%u</td>"
|
||||||
|
"</tr>",
|
||||||
|
Total);
|
||||||
|
|
||||||
|
/***** End frame *****/
|
||||||
|
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
||||||
|
Lay_EndRoundFrameTable10 ();
|
||||||
|
else
|
||||||
|
Lay_EndSquareFrameTable ();
|
||||||
|
|
||||||
|
/***** Free memory used for user's data *****/
|
||||||
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Write table heading for listing of students in several attendance events **/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Att_WriteTableHeadSeveralAttEvents (void)
|
||||||
|
{
|
||||||
|
extern const char *Txt_ROLES_SINGULAR_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||||
|
extern const char *Txt_Attendance;
|
||||||
|
unsigned NumAttEvent;
|
||||||
|
|
||||||
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
"<th align=\"left\" colspan=\"%u\" class=\"TIT_TBL\">%s</th>",
|
||||||
|
Gbl.Usrs.Listing.WithPhotos ? 4 :
|
||||||
|
3,
|
||||||
|
Txt_ROLES_SINGULAR_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN]);
|
||||||
|
|
||||||
|
for (NumAttEvent = 0;
|
||||||
|
NumAttEvent < Gbl.AttEvents.Num;
|
||||||
|
NumAttEvent++)
|
||||||
|
if (Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList)
|
||||||
|
{
|
||||||
|
/***** Get data of this attendance event *****/
|
||||||
|
Att_GetDataOfAttEventByCodAndCheckCrs (&Gbl.AttEvents.Lst[NumAttEvent]);
|
||||||
|
|
||||||
|
fprintf (Gbl.F.Out,"<th align=\"center\" class=\"TIT_TBL\">"
|
||||||
|
"<span class=\"TIT_TBL\" title=\"%s\">%u</span>"
|
||||||
|
"</th>",
|
||||||
|
Gbl.AttEvents.Lst[NumAttEvent].Title,NumAttEvent+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf (Gbl.F.Out,"<th align=\"right\" class=\"TIT_TBL\">%s</th>"
|
||||||
|
"</tr>",
|
||||||
|
Txt_Attendance);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************ Write a row of a table with the data of a student **************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *UsrDat)
|
||||||
|
{
|
||||||
|
extern const char *Txt_Present;
|
||||||
|
extern const char *Txt_Absent;
|
||||||
|
const char *BgColor;
|
||||||
|
char PhotoURL[PATH_MAX+1];
|
||||||
|
bool ShowPhoto;
|
||||||
|
unsigned NumAttEvent;
|
||||||
|
bool Present;
|
||||||
|
unsigned NumTimesPresent;
|
||||||
|
|
||||||
|
BgColor = Gbl.ColorRows[Gbl.RowEvenOdd];
|
||||||
|
|
||||||
|
/***** Write number of student in the list *****/
|
||||||
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
"<td align=\"right\" valign=\"middle\" bgcolor=\"%s\" class=\"%s\">%u</td>",
|
||||||
|
BgColor,
|
||||||
|
UsrDat->Accepted ? "DAT_SMALL_N" :
|
||||||
|
"DAT_SMALL",
|
||||||
|
NumStd + 1);
|
||||||
|
|
||||||
|
/***** Show student's photo *****/
|
||||||
|
if (Gbl.Usrs.Listing.WithPhotos)
|
||||||
|
{
|
||||||
|
fprintf (Gbl.F.Out,"<td align=\"left\" valign=\"middle\" bgcolor=\"%s\" width=\"18\">",BgColor);
|
||||||
|
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
|
||||||
|
Pho_ShowUsrPhoto (UsrDat,
|
||||||
|
ShowPhoto ? PhotoURL :
|
||||||
|
NULL,
|
||||||
|
18,24,
|
||||||
|
Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW);
|
||||||
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Write user's ID ******/
|
||||||
|
fprintf (Gbl.F.Out,"<td align=\"left\" valign=\"middle\" bgcolor=\"%s\" class=\"%s\">",
|
||||||
|
BgColor,
|
||||||
|
UsrDat->Accepted ? "DAT_SMALL_N" :
|
||||||
|
"DAT_SMALL");
|
||||||
|
ID_WriteUsrIDs (UsrDat,true);
|
||||||
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
|
/***** Write student's name *****/
|
||||||
|
fprintf (Gbl.F.Out,"<td align=\"left\" valign=\"middle\" bgcolor=\"%s\" class=\"%s\">%s",
|
||||||
|
BgColor,
|
||||||
|
UsrDat->Accepted ? "DAT_SMALL_N" :
|
||||||
|
"DAT_SMALL",
|
||||||
|
UsrDat->Surname1);
|
||||||
|
if (UsrDat->Surname2[0])
|
||||||
|
fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
|
||||||
|
fprintf (Gbl.F.Out,", %s</td>",
|
||||||
|
UsrDat->FirstName);
|
||||||
|
|
||||||
|
/***** Icon to show if the user is already registered *****/
|
||||||
|
for (NumAttEvent = 0, NumTimesPresent = 0;
|
||||||
|
NumAttEvent < Gbl.AttEvents.Num;
|
||||||
|
NumAttEvent++)
|
||||||
|
if (Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList)
|
||||||
|
{
|
||||||
|
/***** Check if this student is already registered in the current event *****/
|
||||||
|
// Here it is not necessary to get comments
|
||||||
|
Present = Att_CheckIfUsrIsPresentInAttEvent (Gbl.AttEvents.Lst[NumAttEvent].AttCod,UsrDat->UsrCod);
|
||||||
|
|
||||||
|
fprintf (Gbl.F.Out,"<td class=\"BM%d\">"
|
||||||
|
"<img src=\"%s/%s16x16.gif\""
|
||||||
|
" alt=\"\" title=\"%s\" class=\"ICON16x16\" />"
|
||||||
|
"</td>",
|
||||||
|
Gbl.RowEvenOdd,
|
||||||
|
Gbl.Prefs.IconsURL,
|
||||||
|
Present ? "check" :
|
||||||
|
"check-empty",
|
||||||
|
Present ? Txt_Present :
|
||||||
|
Txt_Absent);
|
||||||
|
|
||||||
|
if (Present)
|
||||||
|
NumTimesPresent++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Last column with the number of times this user is present *****/
|
||||||
|
fprintf (Gbl.F.Out,"<td align=\"right\" valign=\"middle\" bgcolor=\"%s\" class=\"DAT_N\">%u</td>"
|
||||||
|
"</tr>",
|
||||||
|
BgColor,NumTimesPresent);
|
||||||
|
|
||||||
|
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/**************** List the students with details and comments ****************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Att_ListStdsWithAttEventsDetails (unsigned NumStdsInList,long *LstSelectedUsrCods)
|
||||||
|
{
|
||||||
|
extern const char *Txt_Details;
|
||||||
|
struct UsrData UsrDat;
|
||||||
|
unsigned NumStd;
|
||||||
|
|
||||||
|
/***** Initialize structure with user's data *****/
|
||||||
|
Usr_UsrDataConstructor (&UsrDat);
|
||||||
|
|
||||||
|
/***** Start frame *****/
|
||||||
|
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
||||||
|
Lay_StartRoundFrameTable10 (NULL,2,Txt_Details);
|
||||||
|
else
|
||||||
|
Lay_StartSquareFrameTable (NULL,NULL,NULL,2);
|
||||||
|
|
||||||
|
/***** List students with attendance details *****/
|
||||||
|
for (NumStd = 0;
|
||||||
|
NumStd < NumStdsInList;
|
||||||
|
NumStd++)
|
||||||
|
{
|
||||||
|
UsrDat.UsrCod = LstSelectedUsrCods[NumStd];
|
||||||
|
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get from the database the data of the student
|
||||||
|
{
|
||||||
|
UsrDat.Accepted = Usr_GetIfUserHasAcceptedEnrollmentInCurrentCrs (UsrDat.UsrCod);
|
||||||
|
Att_ListAttEventsForAStd (NumStd,&UsrDat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** End frame *****/
|
||||||
|
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
||||||
|
Lay_EndRoundFrameTable10 ();
|
||||||
|
else
|
||||||
|
Lay_EndSquareFrameTable ();
|
||||||
|
|
||||||
|
/***** Free memory used for user's data *****/
|
||||||
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*************** Write list of attendance events for a student ***************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// If UsrDat == NULL ==> don't show comments
|
|
||||||
// If UsrDat != NULL ==> show comments
|
|
||||||
|
|
||||||
static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat)
|
static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat)
|
||||||
{
|
{
|
||||||
|
@ -2981,128 +3158,3 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat)
|
||||||
|
|
||||||
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/* Write table heading for listing of students in several attendance events **/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void Att_WriteTableHeadSeveralAttEvents (void)
|
|
||||||
{
|
|
||||||
extern const char *Txt_ROLES_SINGULAR_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
|
||||||
extern const char *Txt_Attendance;
|
|
||||||
unsigned NumAttEvent;
|
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
|
||||||
"<th align=\"left\" colspan=\"%u\" class=\"TIT_TBL\">%s</th>",
|
|
||||||
Gbl.Usrs.Listing.WithPhotos ? 4 :
|
|
||||||
3,
|
|
||||||
Txt_ROLES_SINGULAR_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN]);
|
|
||||||
|
|
||||||
for (NumAttEvent = 0;
|
|
||||||
NumAttEvent < Gbl.AttEvents.Num;
|
|
||||||
NumAttEvent++)
|
|
||||||
if (Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList)
|
|
||||||
{
|
|
||||||
/***** Get data of this attendance event *****/
|
|
||||||
Att_GetDataOfAttEventByCodAndCheckCrs (&Gbl.AttEvents.Lst[NumAttEvent]);
|
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<th align=\"center\" class=\"TIT_TBL\">"
|
|
||||||
"<span class=\"TIT_TBL\" title=\"%s\">%u</span>"
|
|
||||||
"</th>",
|
|
||||||
Gbl.AttEvents.Lst[NumAttEvent].Title,NumAttEvent+1);
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<th align=\"right\" class=\"TIT_TBL\">%s</th>"
|
|
||||||
"</tr>",
|
|
||||||
Txt_Attendance);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/************ Write a row of a table with the data of a student **************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *UsrDat)
|
|
||||||
{
|
|
||||||
extern const char *Txt_Present;
|
|
||||||
extern const char *Txt_Absent;
|
|
||||||
const char *BgColor;
|
|
||||||
char PhotoURL[PATH_MAX+1];
|
|
||||||
bool ShowPhoto;
|
|
||||||
unsigned NumAttEvent;
|
|
||||||
bool Present;
|
|
||||||
unsigned NumTimesPresent;
|
|
||||||
|
|
||||||
BgColor = Gbl.ColorRows[Gbl.RowEvenOdd];
|
|
||||||
|
|
||||||
/***** Write number of student in the list *****/
|
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
|
||||||
"<td align=\"right\" valign=\"middle\" bgcolor=\"%s\" class=\"%s\">%u</td>",
|
|
||||||
BgColor,
|
|
||||||
UsrDat->Accepted ? "DAT_SMALL_N" :
|
|
||||||
"DAT_SMALL",
|
|
||||||
NumStd + 1);
|
|
||||||
|
|
||||||
/***** Show student's photo *****/
|
|
||||||
if (Gbl.Usrs.Listing.WithPhotos)
|
|
||||||
{
|
|
||||||
fprintf (Gbl.F.Out,"<td align=\"left\" valign=\"middle\" bgcolor=\"%s\" width=\"18\">",BgColor);
|
|
||||||
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
|
|
||||||
Pho_ShowUsrPhoto (UsrDat,
|
|
||||||
ShowPhoto ? PhotoURL :
|
|
||||||
NULL,
|
|
||||||
18,24,
|
|
||||||
Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW);
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Write user's ID ******/
|
|
||||||
fprintf (Gbl.F.Out,"<td align=\"left\" valign=\"middle\" bgcolor=\"%s\" class=\"%s\">",
|
|
||||||
BgColor,
|
|
||||||
UsrDat->Accepted ? "DAT_SMALL_N" :
|
|
||||||
"DAT_SMALL");
|
|
||||||
ID_WriteUsrIDs (UsrDat,true);
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
|
||||||
|
|
||||||
/***** Write student's name *****/
|
|
||||||
fprintf (Gbl.F.Out,"<td align=\"left\" valign=\"middle\" bgcolor=\"%s\" class=\"%s\">%s",
|
|
||||||
BgColor,
|
|
||||||
UsrDat->Accepted ? "DAT_SMALL_N" :
|
|
||||||
"DAT_SMALL",
|
|
||||||
UsrDat->Surname1);
|
|
||||||
if (UsrDat->Surname2[0])
|
|
||||||
fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
|
|
||||||
fprintf (Gbl.F.Out,", %s</td>",
|
|
||||||
UsrDat->FirstName);
|
|
||||||
|
|
||||||
/***** Icon to show if the user is already registered *****/
|
|
||||||
for (NumAttEvent = 0, NumTimesPresent = 0;
|
|
||||||
NumAttEvent < Gbl.AttEvents.Num;
|
|
||||||
NumAttEvent++)
|
|
||||||
if (Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList)
|
|
||||||
{
|
|
||||||
/***** Check if this student is already registered in the current event *****/
|
|
||||||
// Here it is not necessary to get comments
|
|
||||||
Present = Att_CheckIfUsrIsPresentInAttEvent (Gbl.AttEvents.Lst[NumAttEvent].AttCod,UsrDat->UsrCod);
|
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<td class=\"BM%d\">"
|
|
||||||
"<img src=\"%s/%s16x16.gif\""
|
|
||||||
" alt=\"\" title=\"%s\" class=\"ICON16x16\" />"
|
|
||||||
"</td>",
|
|
||||||
Gbl.RowEvenOdd,
|
|
||||||
Gbl.Prefs.IconsURL,
|
|
||||||
Present ? "check" :
|
|
||||||
"check-empty",
|
|
||||||
Present ? Txt_Present :
|
|
||||||
Txt_Absent);
|
|
||||||
|
|
||||||
if (Present)
|
|
||||||
NumTimesPresent++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Last column with the number of times this user is present *****/
|
|
||||||
fprintf (Gbl.F.Out,"<td align=\"right\" valign=\"middle\" bgcolor=\"%s\" class=\"DAT_N\">%u</td>"
|
|
||||||
"</tr>",
|
|
||||||
BgColor,NumTimesPresent);
|
|
||||||
|
|
||||||
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
|
||||||
}
|
|
||||||
|
|
|
@ -35,12 +35,13 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 14.31.1 (2014/12/05)"
|
#define Log_PLATFORM_VERSION "SWAD 14.32 (2014/12/06)"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
||||||
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h | tail -1
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h | tail -1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Version 14.32 :Dic 06, 2014 Changes in listing of attendance. (170509 lines)
|
||||||
Version 14.31.1 :Dic 05, 2014 Comments are shown in list of attendances when several students are listed. (170450 lines)
|
Version 14.31.1 :Dic 05, 2014 Comments are shown in list of attendances when several students are listed. (170450 lines)
|
||||||
Version 14.31 :Dic 04, 2014 Comments are shown in list of attendances when one unique student is listed. (170353 lines)
|
Version 14.31 :Dic 04, 2014 Comments are shown in list of attendances when one unique student is listed. (170353 lines)
|
||||||
Version 14.30.2 :Dic 03, 2014 Changes in sign up.
|
Version 14.30.2 :Dic 03, 2014 Changes in sign up.
|
||||||
|
|
21
swad_text.c
21
swad_text.c
|
@ -7533,6 +7533,27 @@ const char *Txt_Description =
|
||||||
"Descrição";
|
"Descrição";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char *Txt_Details =
|
||||||
|
#if L==0
|
||||||
|
"Detalls";
|
||||||
|
#elif L==1
|
||||||
|
"Einzelheiten";
|
||||||
|
#elif L==2
|
||||||
|
"Details";
|
||||||
|
#elif L==3
|
||||||
|
"Detalles";
|
||||||
|
#elif L==4
|
||||||
|
"Détails";
|
||||||
|
#elif L==5
|
||||||
|
"Detalles"; // Okoteve traducción
|
||||||
|
#elif L==6
|
||||||
|
"Dettagli";
|
||||||
|
#elif L==7
|
||||||
|
"Szczegóły";
|
||||||
|
#elif L==8
|
||||||
|
"Detalhes";
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *Txt_Direct_authentication =
|
const char *Txt_Direct_authentication =
|
||||||
#if L==0
|
#if L==0
|
||||||
"¿Autenticació directa?";
|
"¿Autenticació directa?";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user