mirror of https://github.com/acanas/swad-core.git
Version 16.220.1
This commit is contained in:
parent
5d727d5448
commit
a65d5b0524
|
@ -313,6 +313,7 @@ static void Acc_WriteRowEmptyAccount (unsigned NumUsr,const char *ID,struct UsrD
|
|||
Gbl.RowEvenOdd);
|
||||
UsrDat->Sex = Usr_SEX_UNKNOWN;
|
||||
Crs_GetAndWriteCrssOfAUsr (UsrDat,Rol_TCH);
|
||||
Crs_GetAndWriteCrssOfAUsr (UsrDat,Rol_NED_TCH);
|
||||
Crs_GetAndWriteCrssOfAUsr (UsrDat,Rol_STD);
|
||||
fprintf (Gbl.F.Out,"</td>"
|
||||
"</tr>");
|
||||
|
|
|
@ -2475,11 +2475,11 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
/* ActReqEnrSevStd */{1426,-1,TabUnk,ActLstStd ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Enr_ReqAdminStds ,NULL},
|
||||
/* ActReqEnrSevTch */{1427,-1,TabUnk,ActLstTch ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Enr_ReqAdminTchs ,NULL},
|
||||
|
||||
/* ActReqLstStdAtt */{1073,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Usr_ReqListStdsAttendanceCrs ,NULL},
|
||||
/* ActReqLstStdAtt */{1073,-1,TabUnk,ActSeeAtt ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Usr_ReqListStdsAttendanceCrs ,NULL},
|
||||
/* ActSeeLstMyAtt */{1473,-1,TabUnk,ActSeeAtt ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Usr_ListMyAttendanceCrs ,NULL},
|
||||
/* ActPrnLstMyAtt */{1474,-1,TabUnk,ActSeeAtt ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Usr_PrintMyAttendanceCrs ,NULL},
|
||||
/* ActSeeLstStdAtt */{1074,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Usr_ListStdsAttendanceCrs ,NULL},
|
||||
/* ActPrnLstStdAtt */{1075,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Usr_PrintStdsAttendanceCrs ,NULL},
|
||||
/* ActSeeLstStdAtt */{1074,-1,TabUnk,ActSeeAtt ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Usr_ListStdsAttendanceCrs ,NULL},
|
||||
/* ActPrnLstStdAtt */{1075,-1,TabUnk,ActSeeAtt ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Usr_PrintStdsAttendanceCrs ,NULL},
|
||||
/* ActFrmNewAtt */{1063,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Att_RequestCreatOrEditAttEvent ,NULL},
|
||||
/* ActEdiOneAtt */{1064,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Att_RequestCreatOrEditAttEvent ,NULL},
|
||||
/* ActNewAtt */{1065,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Att_RecFormAttEvent ,NULL},
|
||||
|
@ -5111,9 +5111,20 @@ void Act_AdjustCurrentAction (void)
|
|||
the only action possible is show a form to ask for enrolment *****/
|
||||
if (!Gbl.Usrs.Me.UsrDat.Accepted && Gbl.Action.Act != ActLogOut)
|
||||
{
|
||||
Gbl.Action.Act = (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STD) ? ActReqAccEnrStd :
|
||||
ActReqAccEnrTch;
|
||||
Tab_SetCurrentTab ();
|
||||
switch (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB)
|
||||
{
|
||||
case Rol_STD:
|
||||
Gbl.Action.Act = ActReqAccEnrStd;
|
||||
Tab_SetCurrentTab ();
|
||||
break;
|
||||
case Rol_NED_TCH:
|
||||
case Rol_TCH:
|
||||
Gbl.Action.Act = ActReqAccEnrTch;
|
||||
Tab_SetCurrentTab ();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5171,6 +5182,8 @@ void Act_AdjustCurrentAction (void)
|
|||
if (Gbl.Action.Act == ActMnu) // Do the following check sometimes, for example when the user changes the current tab
|
||||
Gbl.CurrentCrs.Info.ShowMsgMustBeRead = Inf_GetIfIMustReadAnyCrsInfoInThisCrs ();
|
||||
break;
|
||||
case Rol_NED_TCH:
|
||||
break;
|
||||
case Rol_TCH:
|
||||
if (Gbl.Action.Act == ActReqTst ||
|
||||
Gbl.Action.Act == ActEdiTstQst)
|
||||
|
|
|
@ -425,13 +425,15 @@ void Ann_ShowFormAnnouncement (void)
|
|||
"<td class=\"DAT LEFT_TOP\">",
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_Users);
|
||||
Rol_WriteSelectorRoles (1 << Rol_UNK |
|
||||
1 << Rol_GST |
|
||||
1 << Rol_STD |
|
||||
Rol_WriteSelectorRoles (1 << Rol_UNK |
|
||||
1 << Rol_GST |
|
||||
1 << Rol_STD |
|
||||
1 << Rol_NED_TCH |
|
||||
1 << Rol_TCH,
|
||||
1 << Rol_UNK |
|
||||
1 << Rol_GST |
|
||||
1 << Rol_STD |
|
||||
1 << Rol_UNK |
|
||||
1 << Rol_GST |
|
||||
1 << Rol_STD |
|
||||
1 << Rol_NED_TCH |
|
||||
1 << Rol_TCH,
|
||||
false,false);
|
||||
fprintf (Gbl.F.Out,"</td>"
|
||||
|
|
|
@ -589,6 +589,7 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden)
|
|||
Lay_PutContextualIconToEdit (ActEdiOneAsg,Asg_PutParams);
|
||||
// no break
|
||||
case Rol_STD:
|
||||
case Rol_NED_TCH:
|
||||
/***** Put form to print assignment *****/
|
||||
Lay_PutContextualIconToPrint (ActPrnOneAsg,Asg_PutParams);
|
||||
break;
|
||||
|
@ -1713,27 +1714,35 @@ static bool Asg_CheckIfIBelongToCrsOrGrpsThisAssignment (long AsgCod)
|
|||
{
|
||||
char Query[512];
|
||||
|
||||
if (Gbl.Usrs.Me.LoggedRole == Rol_STD ||
|
||||
Gbl.Usrs.Me.LoggedRole == Rol_TCH)
|
||||
switch (Gbl.Usrs.Me.LoggedRole)
|
||||
{
|
||||
// Students and teachers can edit assignments depending on groups
|
||||
/***** Get if I can edit an assignment from database *****/
|
||||
sprintf (Query,"SELECT COUNT(*) FROM assignments"
|
||||
" WHERE AsgCod=%ld"
|
||||
" AND "
|
||||
"("
|
||||
"AsgCod NOT IN (SELECT AsgCod FROM asg_grp)" // Assignment is for the whole course
|
||||
" OR "
|
||||
"AsgCod IN" // Assignment is for specific groups
|
||||
" (SELECT asg_grp.AsgCod FROM asg_grp,crs_grp_usr"
|
||||
" WHERE crs_grp_usr.UsrCod=%ld"
|
||||
" AND asg_grp.GrpCod=crs_grp_usr.GrpCod)"
|
||||
")",
|
||||
AsgCod,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
return (DB_QueryCOUNT (Query,"can not check if I can do an assignment") != 0);
|
||||
case Rol_STD:
|
||||
case Rol_NED_TCH:
|
||||
case Rol_TCH:
|
||||
// Students and teachers can do assignments depending on groups
|
||||
/***** Get if I can do an assignment from database *****/
|
||||
sprintf (Query,"SELECT COUNT(*) FROM assignments"
|
||||
" WHERE AsgCod=%ld"
|
||||
" AND "
|
||||
"("
|
||||
"AsgCod NOT IN (SELECT AsgCod FROM asg_grp)" // Assignment is for the whole course
|
||||
" OR "
|
||||
"AsgCod IN" // Assignment is for specific groups
|
||||
" (SELECT asg_grp.AsgCod FROM asg_grp,crs_grp_usr"
|
||||
" WHERE crs_grp_usr.UsrCod=%ld"
|
||||
" AND asg_grp.GrpCod=crs_grp_usr.GrpCod)"
|
||||
")",
|
||||
AsgCod,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
return (DB_QueryCOUNT (Query,"can not check if I can do an assignment") != 0);
|
||||
case Rol_DEG_ADM:
|
||||
case Rol_CTR_ADM:
|
||||
case Rol_INS_ADM:
|
||||
case Rol_SYS_ADM:
|
||||
// Admins can view assignments
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return (Gbl.Usrs.Me.LoggedRole > Rol_TCH); // Admins can edit assignments
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -101,7 +101,9 @@ static void Att_RemoveAttEventFromCurrentCrs (long AttCod);
|
|||
|
||||
static void Att_ListAttOnlyMeAsStudent (struct AttendanceEvent *Att);
|
||||
static void Att_ListAttStudents (struct AttendanceEvent *Att);
|
||||
static void Att_WriteRowStdToCallTheRoll (unsigned NumStd,struct UsrData *UsrDat,struct AttendanceEvent *Att);
|
||||
static void Att_WriteRowStdToCallTheRoll (unsigned NumStd,
|
||||
struct UsrData *UsrDat,
|
||||
struct AttendanceEvent *Att);
|
||||
static void Att_PutParamsCodGrps (long AttCod);
|
||||
static void Att_GetNumStdsTotalWhoAreInAttEvent (struct AttendanceEvent *Att);
|
||||
static unsigned Att_GetNumStdsFromAListWhoAreInAttEvent (long AttCod,long LstSelectedUsrCods[],unsigned NumStdsInList);
|
||||
|
@ -166,6 +168,7 @@ void Att_SeeAttEvents (void)
|
|||
case Rol_STD:
|
||||
Att_PutFormToListMyAttendance ();
|
||||
break;
|
||||
case Rol_NED_TCH:
|
||||
case Rol_TCH:
|
||||
case Rol_SYS_ADM:
|
||||
Att_PutFormToListStdsAttendance ();
|
||||
|
@ -232,8 +235,8 @@ static void Att_ShowAllAttEvents (void)
|
|||
{
|
||||
/***** Table head *****/
|
||||
Lay_StartTableWideMargin (2);
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<th class=\"CONTEXT_COL\"></th>"); // Column for contextual icons
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<th class=\"CONTEXT_COL\"></th>"); // Column for contextual icons
|
||||
for (Order = Dat_START_TIME;
|
||||
Order <= Dat_END_TIME;
|
||||
Order++)
|
||||
|
@ -1822,6 +1825,7 @@ void Att_SeeOneAttEvent (void)
|
|||
case Rol_STD:
|
||||
Att_ListAttOnlyMeAsStudent (&Att);
|
||||
break;
|
||||
case Rol_NED_TCH:
|
||||
case Rol_TCH:
|
||||
case Rol_SYS_ADM:
|
||||
/***** Show list of students *****/
|
||||
|
@ -1998,7 +2002,9 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att)
|
|||
/************ Write a row of a table with the data of a student **************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Att_WriteRowStdToCallTheRoll (unsigned NumStd,struct UsrData *UsrDat,struct AttendanceEvent *Att)
|
||||
static void Att_WriteRowStdToCallTheRoll (unsigned NumStd,
|
||||
struct UsrData *UsrDat,
|
||||
struct AttendanceEvent *Att)
|
||||
{
|
||||
extern const char *Txt_Present;
|
||||
extern const char *Txt_Absent;
|
||||
|
@ -2007,6 +2013,37 @@ static void Att_WriteRowStdToCallTheRoll (unsigned NumStd,struct UsrData *UsrDat
|
|||
bool ShowPhoto;
|
||||
char CommentStd[Cns_MAX_BYTES_TEXT + 1];
|
||||
char CommentTch[Cns_MAX_BYTES_TEXT + 1];
|
||||
bool ICanChangeStdAttendance;
|
||||
bool ICanEditStdComment;
|
||||
bool ICanEditTchComment;
|
||||
|
||||
/***** Set who can edit *****/
|
||||
switch (Gbl.Usrs.Me.LoggedRole)
|
||||
{
|
||||
case Rol_STD:
|
||||
// A student can see only her/his attendance
|
||||
if (UsrDat->UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod)
|
||||
Lay_ShowErrorAndExit ("Wrong call.");
|
||||
ICanChangeStdAttendance = false;
|
||||
ICanEditStdComment = Att->Open; // Attendance event is open
|
||||
ICanEditTchComment = false;
|
||||
break;
|
||||
case Rol_TCH:
|
||||
ICanChangeStdAttendance = true;
|
||||
ICanEditStdComment = false;
|
||||
ICanEditTchComment = true;
|
||||
break;
|
||||
case Rol_SYS_ADM:
|
||||
ICanChangeStdAttendance = true;
|
||||
ICanEditStdComment = false;
|
||||
ICanEditTchComment = false;
|
||||
break;
|
||||
default:
|
||||
ICanChangeStdAttendance = false;
|
||||
ICanEditStdComment = false;
|
||||
ICanEditTchComment = false;
|
||||
break;
|
||||
}
|
||||
|
||||
/***** Check if this student is already registered in the current event *****/
|
||||
Present = Att_CheckIfUsrIsPresentInAttEventAndGetComments (Att->AttCod,UsrDat->UsrCod,CommentStd,CommentTch);
|
||||
|
@ -2036,7 +2073,7 @@ static void Att_WriteRowStdToCallTheRoll (unsigned NumStd,struct UsrData *UsrDat
|
|||
UsrDat->EncryptedUsrCod);
|
||||
if (Present) // This student has attended to the event?
|
||||
fprintf (Gbl.F.Out," checked=\"checked\"");
|
||||
if (Gbl.Usrs.Me.LoggedRole == Rol_STD) // A student can not change his attendance
|
||||
if (!ICanChangeStdAttendance)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," />"
|
||||
"</td>");
|
||||
|
@ -2084,13 +2121,13 @@ static void Att_WriteRowStdToCallTheRoll (unsigned NumStd,struct UsrData *UsrDat
|
|||
/***** Student's comment: write form or text */
|
||||
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL LEFT_TOP COLOR%u\">",
|
||||
Gbl.RowEvenOdd);
|
||||
if (Gbl.Usrs.Me.LoggedRole == Rol_STD && Att->Open) // Show with form
|
||||
if (ICanEditStdComment) // Show with form
|
||||
fprintf (Gbl.F.Out,"<textarea name=\"CommentStd%ld\""
|
||||
" cols=\"40\" rows=\"3\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
UsrDat->UsrCod,CommentStd);
|
||||
else // Show without form
|
||||
else // Show without form
|
||||
{
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
CommentStd,Cns_MAX_BYTES_TEXT,false);
|
||||
|
@ -2101,13 +2138,13 @@ static void Att_WriteRowStdToCallTheRoll (unsigned NumStd,struct UsrData *UsrDat
|
|||
/***** Teacher's comment: write form, text or nothing */
|
||||
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL LEFT_TOP COLOR%u\">",
|
||||
Gbl.RowEvenOdd);
|
||||
if (Gbl.Usrs.Me.LoggedRole == Rol_TCH) // Show with form
|
||||
if (ICanEditTchComment) // Show with form
|
||||
fprintf (Gbl.F.Out,"<textarea name=\"CommentTch%ld\""
|
||||
" cols=\"40\" rows=\"3\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
UsrDat->UsrCod,CommentTch);
|
||||
else if (Att->CommentTchVisible) // Show without form
|
||||
else if (Att->CommentTchVisible) // Show without form
|
||||
{
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
CommentTch,Cns_MAX_BYTES_TEXT,false);
|
||||
|
|
|
@ -631,6 +631,19 @@ static void Ctr_Configuration (bool PrintView)
|
|||
Txt_ROLES_PLURAL_Abc[Rol_TCH][Usr_SEX_UNKNOWN],
|
||||
Usr_GetNumUsrsInCrssOfCtr (Rol_TCH,Gbl.CurrentCtr.Ctr.CtrCod));
|
||||
|
||||
/***** Number of non-editing teachers in courses of this centre *****/
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<td class=\"%s RIGHT_MIDDLE\">"
|
||||
"%s:"
|
||||
"</td>"
|
||||
"<td class=\"DAT LEFT_MIDDLE\">"
|
||||
"%u"
|
||||
"</td>"
|
||||
"</tr>",
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_ROLES_PLURAL_Abc[Rol_NED_TCH][Usr_SEX_UNKNOWN],
|
||||
Usr_GetNumUsrsInCrssOfCtr (Rol_NED_TCH,Gbl.CurrentCtr.Ctr.CtrCod));
|
||||
|
||||
/***** Number of students in courses of this centre *****/
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<td class=\"%s RIGHT_MIDDLE\">"
|
||||
|
@ -647,15 +660,16 @@ static void Ctr_Configuration (bool PrintView)
|
|||
/***** Number of users in courses of this centre *****/
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<td class=\"%s RIGHT_MIDDLE\">"
|
||||
"%s + %s:"
|
||||
"%s + %s + %s:"
|
||||
"</td>"
|
||||
"<td class=\"DAT LEFT_MIDDLE\">"
|
||||
"%u"
|
||||
"</td>"
|
||||
"</tr>",
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_ROLES_PLURAL_Abc[Rol_TCH][Usr_SEX_UNKNOWN],
|
||||
Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN],
|
||||
Txt_ROLES_PLURAL_Abc[Rol_TCH ][Usr_SEX_UNKNOWN],
|
||||
Txt_ROLES_PLURAL_Abc[Rol_NED_TCH][Usr_SEX_UNKNOWN],
|
||||
Txt_ROLES_PLURAL_Abc[Rol_STD ][Usr_SEX_UNKNOWN],
|
||||
Usr_GetNumUsrsInCrssOfCtr (Rol_UNK,Gbl.CurrentCtr.Ctr.CtrCod));
|
||||
}
|
||||
|
||||
|
|
|
@ -233,13 +233,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.220 (2017-05-19)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.220.1 (2017-05-20)"
|
||||
#define CSS_FILE "swad16.209.3.css"
|
||||
#define JS_FILE "swad16.206.3.js"
|
||||
|
||||
// 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 sql/swad*.sql | tail -1
|
||||
/*
|
||||
Version 16.220.1: May 20, 2017 Changes related with new role. Not finished. (219332 lines)
|
||||
Version 16.220: May 19, 2017 Changes permission of actions after creating new role. Not finished. (219227 lines)
|
||||
Version 16.219: May 19, 2017 New role: non-editing teacher. Not finished. (219226 lines)
|
||||
Version 16.218: May 19, 2017 Changes in permissions of actions. (218888 lines)
|
||||
|
|
13
swad_chat.c
13
swad_chat.c
|
@ -140,8 +140,7 @@ void Cht_ShowListOfAvailableChatRooms (void)
|
|||
Txt_Chat_rooms);
|
||||
|
||||
/***** Link to chat available for all the users *****/
|
||||
IsLastItemInLevel[1] = (Gbl.Usrs.Me.LoggedRole != Rol_STD &&
|
||||
Gbl.Usrs.Me.LoggedRole != Rol_TCH &&
|
||||
IsLastItemInLevel[1] = (!Gbl.Usrs.Me.IBelongToCurrentCrs &&
|
||||
!Gbl.Usrs.Me.MyDegs.Num);
|
||||
sprintf (ThisRoomFullName,"%s (%s)",Txt_General,Txt_SEX_PLURAL_abc[Usr_SEX_ALL]);
|
||||
Cht_WriteLinkToChat1 ("GBL_USR",Txt_SEX_PLURAL_Abc[Usr_SEX_ALL],ThisRoomFullName,1,IsLastItemInLevel);
|
||||
|
@ -157,7 +156,8 @@ void Cht_ShowListOfAvailableChatRooms (void)
|
|||
switch (Gbl.Usrs.Me.LoggedRole)
|
||||
{
|
||||
case Rol_STD:
|
||||
sprintf (ThisRoomFullName,"%s (%s)",Txt_General,Txt_ROLES_PLURAL_abc[Rol_STD][Usr_SEX_ALL]);
|
||||
sprintf (ThisRoomFullName,"%s (%s)",
|
||||
Txt_General,Txt_ROLES_PLURAL_abc[Rol_STD][Usr_SEX_ALL]);
|
||||
Cht_WriteLinkToChat1 ("GBL_STD",Txt_Students_ABBREVIATION,ThisRoomFullName,1,IsLastItemInLevel);
|
||||
fprintf (Gbl.F.Out,"<img src=\"%s/chat64x64.gif\""
|
||||
" alt=\"%s\" title=\"%s\""
|
||||
|
@ -166,8 +166,10 @@ void Cht_ShowListOfAvailableChatRooms (void)
|
|||
ThisRoomFullName,ThisRoomFullName);
|
||||
Cht_WriteLinkToChat2 ("GBL_STD",ThisRoomFullName);
|
||||
break;
|
||||
case Rol_NED_TCH:
|
||||
case Rol_TCH:
|
||||
sprintf (ThisRoomFullName,"%s (%s)",Txt_General,Txt_ROLES_PLURAL_abc[Rol_TCH][Usr_SEX_ALL]);
|
||||
sprintf (ThisRoomFullName,"%s (%s)",
|
||||
Txt_General,Txt_ROLES_PLURAL_abc[Rol_TCH][Usr_SEX_ALL]);
|
||||
Cht_WriteLinkToChat1 ("GBL_TCH",Txt_Teachers_ABBREVIATION,ThisRoomFullName,1,IsLastItemInLevel);
|
||||
fprintf (Gbl.F.Out,"<img src=\"%s/chat64x64.gif\""
|
||||
" alt=\"%s\" title=\"%s\""
|
||||
|
@ -479,7 +481,8 @@ void Cht_OpenChatWindow (void)
|
|||
Cht_MAX_BYTES_ROOM_FULL_NAMES);
|
||||
}
|
||||
|
||||
if (Gbl.Usrs.Me.LoggedRole == Rol_TCH)
|
||||
if (Gbl.Usrs.Me.LoggedRole == Rol_NED_TCH ||
|
||||
Gbl.Usrs.Me.LoggedRole == Rol_TCH)
|
||||
if (strcmp (RoomCode,"GBL_TCH"))
|
||||
{
|
||||
Str_Concat (ListRoomCodes,"|#GBL_TCH",
|
||||
|
|
|
@ -435,6 +435,9 @@ void Con_ComputeConnectedUsrsBelongingToCurrentCrs (void)
|
|||
/***** Number of teachers *****/
|
||||
Con_ComputeConnectedUsrsWithARoleBelongingToCurrentCrs (Rol_TCH);
|
||||
|
||||
/***** Number of non-editing teachers *****/
|
||||
Con_ComputeConnectedUsrsWithARoleBelongingToCurrentCrs (Rol_NED_TCH);
|
||||
|
||||
/***** Number of students *****/
|
||||
Con_ComputeConnectedUsrsWithARoleBelongingToCurrentCrs (Rol_STD);
|
||||
}
|
||||
|
@ -482,6 +485,7 @@ static void Con_ShowConnectedUsrsBelongingToLocation (void)
|
|||
/***** Number of teachers and students *****/
|
||||
fprintf (Gbl.F.Out,"<table class=\"CONNECTED_LIST\">");
|
||||
Con_ShowConnectedUsrsWithARoleBelongingToCurrentLocationOnMainZone (Rol_TCH);
|
||||
Con_ShowConnectedUsrsWithARoleBelongingToCurrentLocationOnMainZone (Rol_NED_TCH);
|
||||
Con_ShowConnectedUsrsWithARoleBelongingToCurrentLocationOnMainZone (Rol_STD);
|
||||
if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM)
|
||||
Con_ShowConnectedUsrsWithARoleBelongingToCurrentLocationOnMainZone (Rol_GST);
|
||||
|
@ -528,6 +532,7 @@ void Con_ShowConnectedUsrsBelongingToCurrentCrs (void)
|
|||
Gbl.Usrs.Connected.NumUsrs = 0;
|
||||
Gbl.Usrs.Connected.NumUsrsToList = 0;
|
||||
Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Rol_TCH);
|
||||
Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Rol_NED_TCH);
|
||||
Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Rol_STD);
|
||||
fprintf (Gbl.F.Out,"</table>");
|
||||
|
||||
|
@ -762,6 +767,7 @@ static void Con_GetNumConnectedUsrsWithARoleBelongingCurrentLocation (Rol_Role_t
|
|||
" AND connected.UsrCod=usr_data.UsrCod");
|
||||
break;
|
||||
case Rol_STD:
|
||||
case Rol_NED_TCH:
|
||||
case Rol_TCH:
|
||||
switch (Gbl.Scope.Current)
|
||||
{
|
||||
|
@ -988,10 +994,21 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role)
|
|||
/***** Write full name and link *****/
|
||||
fprintf (Gbl.F.Out,"<td class=\"CON_USR_NARROW %s COLOR%u\">",
|
||||
Font,Gbl.RowEvenOdd);
|
||||
Act_FormStartUnique ((Role == Rol_STD) ? ActSeeRecOneStd :
|
||||
ActSeeRecOneTch); // Must be unique because
|
||||
// the list of connected users
|
||||
// is dynamically updated via AJAX
|
||||
// The form must be unique because
|
||||
// the list of connected users
|
||||
// is dynamically updated via AJAX
|
||||
switch (Role)
|
||||
{
|
||||
case Rol_STD:
|
||||
Act_FormStartUnique (ActSeeRecOneStd);
|
||||
break;
|
||||
case Rol_NED_TCH:
|
||||
case Rol_TCH:
|
||||
Act_FormStartUnique (ActSeeRecOneTch);
|
||||
break;
|
||||
default:
|
||||
Lay_ShowErrorAndExit ("Wrong role");
|
||||
}
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
||||
fprintf (Gbl.F.Out,"<div class=\"CON_NAME_NARROW\">"); // Limited width
|
||||
Act_LinkFormSubmitUnique (Txt_View_record_for_this_course,Font);
|
||||
|
@ -1052,6 +1069,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
|
|||
" ORDER BY Dif");
|
||||
break;
|
||||
case Rol_STD:
|
||||
case Rol_NED_TCH:
|
||||
case Rol_TCH:
|
||||
switch (Gbl.Scope.Current)
|
||||
{
|
||||
|
@ -1182,8 +1200,18 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
|
|||
Font,Gbl.RowEvenOdd);
|
||||
if (PutLinkToRecord)
|
||||
{
|
||||
Act_FormStart ((Role == Rol_STD) ? ActSeeRecOneStd :
|
||||
ActSeeRecOneTch);
|
||||
switch (Role)
|
||||
{
|
||||
case Rol_STD:
|
||||
Act_FormStart (ActSeeRecOneStd);
|
||||
break;
|
||||
case Rol_NED_TCH:
|
||||
case Rol_TCH:
|
||||
Act_FormStart (ActSeeRecOneTch);
|
||||
break;
|
||||
default:
|
||||
Lay_ShowErrorAndExit ("Wrong role");
|
||||
}
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat.EncryptedUsrCod);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"<div class=\"CON_NAME_WIDE\">"); // Limited width
|
||||
|
|
|
@ -3706,7 +3706,7 @@ unsigned Usr_GetNumUsrsInCrssOfDeg (Rol_Role_t Role,long DegCod)
|
|||
/*****************************************************************************/
|
||||
/************ Count how many users with a role belong to a centre ************/
|
||||
/*****************************************************************************/
|
||||
// Here Rol_UNK means students or teachers
|
||||
// Here Rol_UNK means any user (students, non-editing teachers or teachers)
|
||||
|
||||
unsigned Usr_GetNumUsrsInCrssOfCtr (Rol_Role_t Role,long CtrCod)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue