mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-13 04:04:35 +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_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_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 ***********************/
|
||||
|
@ -2638,17 +2640,13 @@ void Usr_ReqListAttendanceStdsCrs (void)
|
|||
void Usr_ListAttendanceStdsCrs (void)
|
||||
{
|
||||
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;
|
||||
unsigned NumStd = 0;
|
||||
unsigned NumStdsInList;
|
||||
unsigned NumStd;
|
||||
long *LstSelectedUsrCods;
|
||||
unsigned NumAttEvent;
|
||||
const char *Ptr;
|
||||
struct UsrData UsrDat;
|
||||
unsigned NumAttEvent;
|
||||
unsigned Total;
|
||||
|
||||
/***** Get list of attendance events *****/
|
||||
Att_GetListAttEvents (Att_OLDEST_FIRST);
|
||||
|
@ -2679,12 +2677,16 @@ void Usr_ListAttendanceStdsCrs (void)
|
|||
LstSelectedUsrCods[NumStd] = UsrDat.UsrCod;
|
||||
}
|
||||
|
||||
/***** Free memory used for user's data *****/
|
||||
Usr_UsrDataDestructor (&UsrDat);
|
||||
|
||||
/***** Get number of students in each event *****/
|
||||
for (NumAttEvent = 0;
|
||||
NumAttEvent < Gbl.AttEvents.Num;
|
||||
NumAttEvent++)
|
||||
/* 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) *****/
|
||||
Att_ListAttEventsWithStds ();
|
||||
|
@ -2692,7 +2694,114 @@ void Usr_ListAttendanceStdsCrs (void)
|
|||
/***** Get my preference about photos in users' list for current course *****/
|
||||
Usr_GetMyPrefAboutListWithPhotosFromDB ();
|
||||
|
||||
/***** Table head *****/
|
||||
/***** Show table with attendances for every student in list *****/
|
||||
Att_ListStdsAttendanceTable (NumStdsInList,LstSelectedUsrCods);
|
||||
|
||||
/***** List the students with details and comments *****/
|
||||
Att_ListStdsWithAttEventsDetails (NumStdsInList,LstSelectedUsrCods);
|
||||
|
||||
/***** Free list of user codes *****/
|
||||
free ((void *) LstSelectedUsrCods);
|
||||
}
|
||||
else // No students selected
|
||||
{
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_You_must_select_one_ore_more_students);
|
||||
Usr_ReqListAttendanceStdsCrs (); // ...show again the form
|
||||
}
|
||||
|
||||
/***** Free memory used for by the list of users *****/
|
||||
Usr_FreeListsEncryptedUsrCods ();
|
||||
|
||||
/***** Free list of attendance events *****/
|
||||
Att_FreeListAttEvents ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********** Write list of those attendance events that have students *********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Att_ListAttEventsWithStds (void)
|
||||
{
|
||||
extern const char *Txt_Events;
|
||||
extern const char *Txt_Event;
|
||||
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||
extern const char *Txt_Present;
|
||||
extern const char *Txt_Absent;
|
||||
extern const char *Txt_Student_comment;
|
||||
extern const char *Txt_Teachers_comment;
|
||||
const char *BgColor;
|
||||
unsigned NumAttEvent;
|
||||
|
||||
/***** Start frame *****/
|
||||
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
||||
Lay_StartRoundFrameTable10 (NULL,2,Txt_Events);
|
||||
else
|
||||
Lay_StartSquareFrameTable (NULL,NULL,NULL,2);
|
||||
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<th colspan=\"2\" align=\"left\" class=\"TIT_TBL\">%s</th>"
|
||||
"<th align=\"right\" class=\"TIT_TBL\">%s</th>"
|
||||
"</tr>",
|
||||
Txt_Event,
|
||||
Txt_ROLES_PLURAL_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN]);
|
||||
|
||||
/***** List the events with students *****/
|
||||
for (NumAttEvent = 0;
|
||||
NumAttEvent < Gbl.AttEvents.Num;
|
||||
NumAttEvent++)
|
||||
if (Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList)
|
||||
{
|
||||
BgColor = Gbl.ColorRows[Gbl.RowEvenOdd];
|
||||
|
||||
/***** Get data of the attendance event from database *****/
|
||||
Att_GetDataOfAttEventByCodAndCheckCrs (&Gbl.AttEvents.Lst[NumAttEvent]);
|
||||
Att_GetNumStdsTotalWhoAreInAttEvent (&Gbl.AttEvents.Lst[NumAttEvent]);
|
||||
|
||||
/***** Write a row for this event *****/
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<td align=\"right\" bgcolor=\"%s\" class=\"DAT\">%u:</td>"
|
||||
"<td align=\"left\" bgcolor=\"%s\" class=\"DAT\">%02u/%02u/%04u %02u:%02u h %s</td>"
|
||||
"<td align=\"right\" bgcolor=\"%s\" class=\"DAT\">%u</td>"
|
||||
"</tr>",
|
||||
BgColor,
|
||||
NumAttEvent + 1,
|
||||
BgColor,
|
||||
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.Year,
|
||||
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Time.Hour,
|
||||
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Time.Minute,
|
||||
Gbl.AttEvents.Lst[NumAttEvent].Title,
|
||||
BgColor,
|
||||
Gbl.AttEvents.Lst[NumAttEvent].NumStdsTotal);
|
||||
|
||||
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
||||
}
|
||||
|
||||
/***** End frame *****/
|
||||
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
||||
Lay_EndRoundFrameTable10 ();
|
||||
else
|
||||
Lay_EndSquareFrameTable ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********** 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
|
||||
|
@ -2734,17 +2843,161 @@ void Usr_ListAttendanceStdsCrs (void)
|
|||
"</tr>",
|
||||
Total);
|
||||
|
||||
/***** Table end *****/
|
||||
/***** End frame *****/
|
||||
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
||||
Lay_EndRoundFrameTable10 ();
|
||||
else
|
||||
Lay_EndSquareFrameTable ();
|
||||
|
||||
/***** List the students with details and comments *****/
|
||||
/***** 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_Comments);
|
||||
Lay_StartRoundFrameTable10 (NULL,2,Txt_Details);
|
||||
else
|
||||
Lay_StartSquareFrameTable (NULL,NULL,NULL,2);
|
||||
|
||||
/***** List students with attendance details *****/
|
||||
for (NumStd = 0;
|
||||
NumStd < NumStdsInList;
|
||||
NumStd++)
|
||||
|
@ -2756,6 +3009,8 @@ void Usr_ListAttendanceStdsCrs (void)
|
|||
Att_ListAttEventsForAStd (NumStd,&UsrDat);
|
||||
}
|
||||
}
|
||||
|
||||
/***** End frame *****/
|
||||
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
||||
Lay_EndRoundFrameTable10 ();
|
||||
else
|
||||
|
@ -2763,90 +3018,12 @@ void Usr_ListAttendanceStdsCrs (void)
|
|||
|
||||
/***** Free memory used for user's data *****/
|
||||
Usr_UsrDataDestructor (&UsrDat);
|
||||
|
||||
/***** Free list of user codes *****/
|
||||
free ((void *) LstSelectedUsrCods);
|
||||
}
|
||||
else // No students selected
|
||||
{
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_You_must_select_one_ore_more_students);
|
||||
Usr_ReqListAttendanceStdsCrs (); // ...show again the form
|
||||
}
|
||||
|
||||
/***** Free memory used for by the list of users *****/
|
||||
Usr_FreeListsEncryptedUsrCods ();
|
||||
|
||||
/***** Free list of attendance events *****/
|
||||
Att_FreeListAttEvents ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********** Write list of those attendance events that have students *********/
|
||||
/*************** Write list of attendance events for a student ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Att_ListAttEventsWithStds (void)
|
||||
{
|
||||
extern const char *Txt_Events;
|
||||
extern const char *Txt_Event;
|
||||
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||
extern const char *Txt_Present;
|
||||
extern const char *Txt_Absent;
|
||||
extern const char *Txt_Student_comment;
|
||||
extern const char *Txt_Teachers_comment;
|
||||
unsigned NumAttEvent;
|
||||
|
||||
/***** Start frame *****/
|
||||
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
||||
Lay_StartRoundFrameTable10 (NULL,2,Txt_Events);
|
||||
else
|
||||
Lay_StartSquareFrameTable (NULL,NULL,NULL,2);
|
||||
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<th colspan=\"2\" align=\"left\" class=\"TIT_TBL\">%s</th>"
|
||||
"<th align=\"right\" class=\"TIT_TBL\">%s</th>"
|
||||
"</tr>",
|
||||
Txt_Event,
|
||||
Txt_ROLES_PLURAL_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN]);
|
||||
|
||||
/***** List the events with students *****/
|
||||
for (NumAttEvent = 0;
|
||||
NumAttEvent < Gbl.AttEvents.Num;
|
||||
NumAttEvent++)
|
||||
if (Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList)
|
||||
{
|
||||
/***** Get data of the attendance event from database *****/
|
||||
Att_GetDataOfAttEventByCodAndCheckCrs (&Gbl.AttEvents.Lst[NumAttEvent]);
|
||||
Att_GetNumStdsTotalWhoAreInAttEvent (&Gbl.AttEvents.Lst[NumAttEvent]);
|
||||
|
||||
/***** Write a row for this event *****/
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<td align=\"right\" class=\"DAT\">%u:</td>"
|
||||
"<td align=\"left\" class=\"DAT\">%02u/%02u/%04u %02u:%02u h %s</td>"
|
||||
"<td align=\"right\" class=\"DAT\">%u</td>"
|
||||
"</tr>",
|
||||
NumAttEvent + 1,
|
||||
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.Year,
|
||||
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Time.Hour,
|
||||
Gbl.AttEvents.Lst[NumAttEvent].DateTimes[Att_START_TIME].Time.Minute,
|
||||
Gbl.AttEvents.Lst[NumAttEvent].Title,
|
||||
Gbl.AttEvents.Lst[NumAttEvent].NumStdsTotal);
|
||||
}
|
||||
|
||||
/***** End frame *****/
|
||||
if (Gbl.CurrentAct == ActSeeLstAttStd)
|
||||
Lay_EndRoundFrameTable10 ();
|
||||
else
|
||||
Lay_EndSquareFrameTable ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********** Write list of those attendance events that have students *********/
|
||||
/*****************************************************************************/
|
||||
// If UsrDat == NULL ==> don't show comments
|
||||
// If UsrDat != NULL ==> show comments
|
||||
|
||||
static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat)
|
||||
{
|
||||
extern const char *Txt_Present;
|
||||
|
@ -2981,128 +3158,3 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat)
|
|||
|
||||
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 *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#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:
|
||||
// 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 :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.
|
||||
|
|
21
swad_text.c
21
swad_text.c
|
@ -7533,6 +7533,27 @@ const char *Txt_Description =
|
|||
"Descrição";
|
||||
#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 =
|
||||
#if L==0
|
||||
"¿Autenticació directa?";
|
||||
|
|
Loading…
Reference in New Issue
Block a user