mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-13 12:14:06 +02:00
Version 14.77.3
This commit is contained in:
parent
7f77bfc277
commit
25d7b52dce
|
@ -103,12 +103,13 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 14.77.2 (2015/03/05)"
|
#define Log_PLATFORM_VERSION "SWAD 14.77.3 (2015/03/05)"
|
||||||
|
|
||||||
// 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.77.2: Mar 05, 2015 Changes in shared record. (? lines)
|
Version 14.77.3: Mar 05, 2015 Changes in shared record. (178509 lines)
|
||||||
|
Version 14.77.2: Mar 05, 2015 Changes in shared record. (178504 lines)
|
||||||
Version 14.77.1: Mar 05, 2015 New option to select the user and then go to his/her public user's profile. (178475 lines)
|
Version 14.77.1: Mar 05, 2015 New option to select the user and then go to his/her public user's profile. (178475 lines)
|
||||||
2 changes necessary in database:
|
2 changes necessary in database:
|
||||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1401','es','N','Solicitar perfil de usuario');
|
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1401','es','N','Solicitar perfil de usuario');
|
||||||
|
|
560
swad_record.c
560
swad_record.c
|
@ -2088,6 +2088,23 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
TypeOfView == Rec_RECORD_PRINT) &&
|
TypeOfView == Rec_RECORD_PRINT) &&
|
||||||
IAmTeacher && Gbl.Usrs.Listing.RecsUsrs == Rec_RECORD_USERS_STUDENTS))));
|
IAmTeacher && Gbl.Usrs.Listing.RecsUsrs == Rec_RECORD_USERS_STUDENTS))));
|
||||||
bool ShowData = ItsMe || UsrDat->Accepted || IAmDegAdmin || IAmSuperuser;
|
bool ShowData = ItsMe || UsrDat->Accepted || IAmDegAdmin || IAmSuperuser;
|
||||||
|
bool ShowMailIDRoleRows = (TypeOfView != Rec_RECORD_PUBLIC);
|
||||||
|
bool ShowAddressRows = (TypeOfView == Rec_FORM_MY_COMMON_RECORD ||
|
||||||
|
TypeOfView == Rec_MY_COMMON_RECORD_CHECK ||
|
||||||
|
TypeOfView == Rec_FORM_MY_COURSE_RECORD ||
|
||||||
|
TypeOfView == Rec_MY_COURSE_RECORD_CHECK ||
|
||||||
|
((TypeOfView == Rec_RECORD_LIST ||
|
||||||
|
TypeOfView == Rec_RECORD_PRINT) &&
|
||||||
|
(IAmTeacher || IAmSuperuser) &&
|
||||||
|
UsrDat->RoleInCurrentCrsDB == Rol_ROLE_STUDENT));
|
||||||
|
bool ShowTeacherRows = (((TypeOfView == Rec_FORM_MY_COMMON_RECORD ||
|
||||||
|
TypeOfView == Rec_MY_COMMON_RECORD_CHECK ||
|
||||||
|
TypeOfView == Rec_FORM_MY_COURSE_RECORD ||
|
||||||
|
TypeOfView == Rec_MY_COURSE_RECORD_CHECK) &&
|
||||||
|
(UsrDat->Roles & (1 << Rol_ROLE_TEACHER))) || // He/she (me, really) is a teacher in any course
|
||||||
|
((TypeOfView == Rec_RECORD_LIST ||
|
||||||
|
TypeOfView == Rec_RECORD_PRINT) &&
|
||||||
|
UsrDat->RoleInCurrentCrsDB == Rol_ROLE_TEACHER)); // He/she is a teacher in the current course
|
||||||
Usr_Sex_t Sex;
|
Usr_Sex_t Sex;
|
||||||
Rol_Role_t Role;
|
Rol_Role_t Role;
|
||||||
Rol_Role_t DefaultRoleInCurrentCrs;
|
Rol_Role_t DefaultRoleInCurrentCrs;
|
||||||
|
@ -2134,6 +2151,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
case Rec_MY_COMMON_RECORD_CHECK:
|
case Rec_MY_COMMON_RECORD_CHECK:
|
||||||
case Rec_OTHER_USR_COMMON_RECORD_CHECK:
|
case Rec_OTHER_USR_COMMON_RECORD_CHECK:
|
||||||
case Rec_RECORD_LIST:
|
case Rec_RECORD_LIST:
|
||||||
|
case Rec_RECORD_PUBLIC:
|
||||||
RecordWidth = Rec_WIDTH_SHARE_RECORD_SMALL;
|
RecordWidth = Rec_WIDTH_SHARE_RECORD_SMALL;
|
||||||
FrameWidth = 10;
|
FrameWidth = 10;
|
||||||
Col3Width = 160;
|
Col3Width = 160;
|
||||||
|
@ -2163,7 +2181,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
/***** Institution *****/
|
/***** Institution *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td colspan=\"2\" style=\"width:%upx;"
|
"<td colspan=\"2\" style=\"width:%upx;"
|
||||||
" text-align:left; vertical-align:middle;\">"
|
" text-align:left; vertical-align:top;\">"
|
||||||
"<table class=\"CELLS_PAD_2\">"
|
"<table class=\"CELLS_PAD_2\">"
|
||||||
"<tr>"
|
"<tr>"
|
||||||
"<td style=\"width:%upx;"
|
"<td style=\"width:%upx;"
|
||||||
|
@ -2304,22 +2322,19 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
/***** Full name *****/
|
/***** Full name *****/
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"<td class=\"HEAD_REC_BIG\" style=\"text-align:left;"
|
"<td class=\"HEAD_REC_BIG\" style=\"text-align:left;"
|
||||||
" vertical-align:middle;\">"
|
" vertical-align:top;\">"
|
||||||
"%s<br />%s<br />%s<br /> "
|
"%s<br />%s<br />%s"
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>"
|
"</tr>"
|
||||||
"</table>"
|
"</table>"
|
||||||
"</td>",
|
"</td>",
|
||||||
UsrDat->FirstName[0] ? UsrDat->FirstName :
|
UsrDat->FirstName ,
|
||||||
" ",
|
UsrDat->Surname1,
|
||||||
UsrDat->Surname1[0] ? UsrDat->Surname1 :
|
UsrDat->Surname2);
|
||||||
" ",
|
|
||||||
UsrDat->Surname2[0] ? UsrDat->Surname2 :
|
|
||||||
" ");
|
|
||||||
|
|
||||||
/***** Photo *****/
|
/***** Photo *****/
|
||||||
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
|
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
|
||||||
fprintf (Gbl.F.Out,"<td rowspan=\"2\" class=\"%s\" style=\"width:%upx;"
|
fprintf (Gbl.F.Out,"<td class=\"%s\" style=\"width:%upx;"
|
||||||
" text-align:center; vertical-align:top;\">",
|
" text-align:center; vertical-align:top;\">",
|
||||||
TypeOfView == Rec_FORM_MY_COMMON_RECORD ? ClassForm :
|
TypeOfView == Rec_FORM_MY_COMMON_RECORD ? ClassForm :
|
||||||
ClassData,
|
ClassData,
|
||||||
|
@ -2376,318 +2391,315 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
if (!DataForm)
|
if (!DataForm)
|
||||||
QR_PutLinkToPrintQRCode (QR_NICKNAME,UsrDat,false);
|
QR_PutLinkToPrintQRCode (QR_NICKNAME,UsrDat,false);
|
||||||
}
|
}
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
|
||||||
"</tr>");
|
|
||||||
|
|
||||||
/***** User's e-mail *****/
|
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
|
||||||
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
|
||||||
"%s:"
|
|
||||||
"</td>"
|
|
||||||
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">",
|
|
||||||
ClassForm,Col1Width,Txt_Email,
|
|
||||||
ClassData,Col2Width);
|
|
||||||
if (UsrDat->Email[0])
|
|
||||||
{
|
|
||||||
if (ShowEmail)
|
|
||||||
{
|
|
||||||
fprintf (Gbl.F.Out,"<a href=\"mailto:%s\"",
|
|
||||||
UsrDat->Email);
|
|
||||||
Str_LimitLengthHTMLStr (UsrDat->Email,36);
|
|
||||||
fprintf (Gbl.F.Out," class=\"%s\">%s</a>",
|
|
||||||
ClassData,UsrDat->Email);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
fprintf (Gbl.F.Out,"********");
|
|
||||||
}
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
/***** User's web and social networks *****/
|
/***** User's web and social networks *****/
|
||||||
fprintf (Gbl.F.Out,"<td rowspan=\"3\" style=\"width:%upx;"
|
fprintf (Gbl.F.Out,"<td style=\"width:%upx;"
|
||||||
" vertical-align:top;\">",
|
" vertical-align:top;\">",
|
||||||
Col3Width);
|
Col3Width);
|
||||||
Net_ShowWebsAndSocialNets (UsrDat->UsrCod);
|
Net_ShowWebsAndSocialNets (UsrDat->UsrCod);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
/***** User's ID *****/
|
if (ShowMailIDRoleRows)
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
|
||||||
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
|
||||||
"%s:"
|
|
||||||
"</td>"
|
|
||||||
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">",
|
|
||||||
ClassForm,Col1Width,Txt_ID,
|
|
||||||
ClassData,Col2Width);
|
|
||||||
ID_WriteUsrIDs (UsrDat,ShowID);
|
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
|
||||||
"</tr>");
|
|
||||||
|
|
||||||
/***** User's role *****/
|
|
||||||
if (RoleForm)
|
|
||||||
{
|
{
|
||||||
|
/***** User's e-mail *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"%s\""
|
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
||||||
" style=\"width:%upx; text-align:left;\">",
|
"%s:"
|
||||||
ClassForm,Col1Width);
|
"</td>"
|
||||||
if (TypeOfView == Rec_FORM_MY_COMMON_RECORD)
|
"<td colspan=\"2\" class=\"%s\""
|
||||||
fprintf (Gbl.F.Out,"%s*",Txt_Sex);
|
" style=\"width:%upx; text-align:left;\">",
|
||||||
else
|
ClassForm,Col1Width,Txt_Email,
|
||||||
fprintf (Gbl.F.Out,"%s",Txt_Role);
|
ClassData,Col2Width);
|
||||||
fprintf (Gbl.F.Out,":</td>"
|
if (UsrDat->Email[0])
|
||||||
"<td class=\"%s\""
|
{
|
||||||
" style=\"width:%upx; text-align:left;\">",
|
if (ShowEmail)
|
||||||
ClassData,Col2Width);
|
{
|
||||||
switch (TypeOfView)
|
fprintf (Gbl.F.Out,"<a href=\"mailto:%s\"",
|
||||||
{
|
UsrDat->Email);
|
||||||
case Rec_FORM_SIGN_UP: // I want to apply for enrollment
|
Str_LimitLengthHTMLStr (UsrDat->Email,36);
|
||||||
DefaultRoleInCurrentCrs = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)) ? Rol_ROLE_TEACHER :
|
fprintf (Gbl.F.Out," class=\"%s\">%s</a>",
|
||||||
Rol_ROLE_STUDENT;
|
ClassData,UsrDat->Email);
|
||||||
fprintf (Gbl.F.Out,"<select name=\"Role\">");
|
}
|
||||||
for (Role = Rol_ROLE_STUDENT;
|
else
|
||||||
Role <= Rol_ROLE_TEACHER;
|
fprintf (Gbl.F.Out,"********");
|
||||||
Role++)
|
}
|
||||||
{
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Role);
|
|
||||||
if (Role == DefaultRoleInCurrentCrs)
|
|
||||||
fprintf (Gbl.F.Out," selected=\"selected\"");
|
|
||||||
fprintf (Gbl.F.Out,">%s</option>",
|
|
||||||
Txt_ROLES_SINGULAR_Abc[Role][UsrDat->Sex]);
|
|
||||||
}
|
|
||||||
fprintf (Gbl.F.Out,"</select>");
|
|
||||||
break;
|
|
||||||
case Rec_FORM_MY_COMMON_RECORD: // It's me, change my data
|
|
||||||
for (Sex = Usr_SEX_FEMALE;
|
|
||||||
Sex <= Usr_SEX_MALE;
|
|
||||||
Sex++)
|
|
||||||
{
|
|
||||||
fprintf (Gbl.F.Out,"<input type=\"radio\" name=\"Sex\" value=\"%u\"",(unsigned) Sex);
|
|
||||||
if (Sex == Gbl.Usrs.Me.UsrDat.Sex)
|
|
||||||
fprintf (Gbl.F.Out," checked=\"checked\"");
|
|
||||||
fprintf (Gbl.F.Out," /><img src=\"%s/%s16x16.gif\" alt=\"%s\""
|
|
||||||
" class=\"ICON16x16\""
|
|
||||||
" style=\"vertical-align:bottom;\" />%s",
|
|
||||||
Gbl.Prefs.IconsURL,Usr_StringsSexDB[Sex],
|
|
||||||
Txt_SEX_SINGULAR_Abc[Sex],
|
|
||||||
Txt_SEX_SINGULAR_Abc[Sex]);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Rec_FORM_MODIFY_RECORD_OTHER_EXISTING_USR: // The other user already exists in the platform
|
|
||||||
if (UsrDat->RoleInCurrentCrsDB < Rol_ROLE_STUDENT) // The other user does not belong to current course
|
|
||||||
{
|
|
||||||
/* If there is a request of this user, default role is the requested role */
|
|
||||||
if ((DefaultRoleInCurrentCrs = Rol_GetRequestedRole (UsrDat->UsrCod)) == Rol_ROLE_UNKNOWN)
|
|
||||||
DefaultRoleInCurrentCrs = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)) ? Rol_ROLE_TEACHER :
|
|
||||||
Rol_ROLE_STUDENT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
DefaultRoleInCurrentCrs = UsrDat->RoleInCurrentCrsDB;
|
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<select name=\"Role\">");
|
/***** User's ID *****/
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
|
||||||
{
|
|
||||||
case Rol_ROLE_GUEST__:
|
|
||||||
case Rol_ROLE_VISITOR:
|
|
||||||
case Rol_ROLE_STUDENT:
|
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\" disabled=\"disabled\">%s</option>",
|
|
||||||
(unsigned) Gbl.Usrs.Me.LoggedRole,
|
|
||||||
Txt_ROLES_SINGULAR_Abc[Gbl.Usrs.Me.LoggedRole][UsrDat->Sex]);
|
|
||||||
break;
|
|
||||||
case Rol_ROLE_TEACHER:
|
|
||||||
for (Role = Rol_ROLE_STUDENT;
|
|
||||||
Role <= Rol_ROLE_TEACHER;
|
|
||||||
Role++)
|
|
||||||
if (Role == Rol_ROLE_STUDENT ||
|
|
||||||
(UsrDat->Roles & (1 << Role))) // A teacher can not upgrade a student (in all other courses) to teacher
|
|
||||||
{
|
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Role);
|
|
||||||
if (Role == DefaultRoleInCurrentCrs)
|
|
||||||
fprintf (Gbl.F.Out," selected=\"selected\"");
|
|
||||||
fprintf (Gbl.F.Out,">%s</option>",
|
|
||||||
Txt_ROLES_SINGULAR_Abc[Role][UsrDat->Sex]);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Rol_ROLE_DEG_ADM:
|
|
||||||
case Rol_ROLE_SYS_ADM:
|
|
||||||
for (Role = Rol_ROLE_STUDENT;
|
|
||||||
Role <= Rol_ROLE_TEACHER;
|
|
||||||
Role++)
|
|
||||||
{
|
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Role);
|
|
||||||
if (Role == DefaultRoleInCurrentCrs)
|
|
||||||
fprintf (Gbl.F.Out," selected=\"selected\"");
|
|
||||||
fprintf (Gbl.F.Out,">%s</option>",
|
|
||||||
Txt_ROLES_SINGULAR_Abc[Role][UsrDat->Sex]);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default: // The rest of users can not register other users
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
fprintf (Gbl.F.Out,"</select>");
|
|
||||||
break;
|
|
||||||
case Rec_FORM_NEW_RECORD_OTHER_NEW_USR: // The other user does not exist in platform
|
|
||||||
fprintf (Gbl.F.Out,"<select name=\"Role\">");
|
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
|
||||||
{
|
|
||||||
case Rol_ROLE_TEACHER: // A teacher only can create students
|
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\">%s</option>",
|
|
||||||
(unsigned) Rol_ROLE_STUDENT,Txt_ROLES_SINGULAR_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN]);
|
|
||||||
break;
|
|
||||||
case Rol_ROLE_DEG_ADM: // An administrator or a superuser can create students and teachers
|
|
||||||
case Rol_ROLE_SYS_ADM:
|
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\">%s</option>"
|
|
||||||
"<option value=\"%u\">%s</option>",
|
|
||||||
(unsigned) Rol_ROLE_STUDENT,Txt_ROLES_SINGULAR_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN],
|
|
||||||
(unsigned) Rol_ROLE_TEACHER,Txt_ROLES_SINGULAR_Abc[Rol_ROLE_TEACHER][Usr_SEX_UNKNOWN]);
|
|
||||||
break;
|
|
||||||
default: // The rest of users can not register other users
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
fprintf (Gbl.F.Out,"</select>");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
|
||||||
"</tr>");
|
|
||||||
}
|
|
||||||
else // RoleForm == false
|
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
||||||
"%s:"
|
"%s:"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
"<td colspan=\"2\" class=\"%s\""
|
||||||
"%s"
|
" style=\"width:%upx; text-align:left;\">",
|
||||||
"</td>"
|
ClassForm,Col1Width,Txt_ID,
|
||||||
"</tr>",
|
ClassData,Col2Width);
|
||||||
ClassForm,Col1Width,
|
ID_WriteUsrIDs (UsrDat,ShowID);
|
||||||
TypeOfView == Rec_MY_COMMON_RECORD_CHECK ? Txt_Sex :
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
Txt_Role,
|
"</tr>");
|
||||||
ClassData,Col2Width,
|
|
||||||
TypeOfView == Rec_MY_COMMON_RECORD_CHECK ? Txt_SEX_SINGULAR_Abc[UsrDat->Sex] :
|
/***** User's role *****/
|
||||||
Txt_ROLES_SINGULAR_Abc[UsrDat->RoleInCurrentCrsDB][UsrDat->Sex]);
|
if (RoleForm)
|
||||||
|
{
|
||||||
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
"<td class=\"%s\""
|
||||||
|
" style=\"width:%upx; text-align:left;\">",
|
||||||
|
ClassForm,Col1Width);
|
||||||
|
if (TypeOfView == Rec_FORM_MY_COMMON_RECORD)
|
||||||
|
fprintf (Gbl.F.Out,"%s*",Txt_Sex);
|
||||||
|
else
|
||||||
|
fprintf (Gbl.F.Out,"%s",Txt_Role);
|
||||||
|
fprintf (Gbl.F.Out,":</td>"
|
||||||
|
"<td colspan=\"2\" class=\"%s\""
|
||||||
|
" style=\"width:%upx; text-align:left;\">",
|
||||||
|
ClassData,Col2Width);
|
||||||
|
switch (TypeOfView)
|
||||||
|
{
|
||||||
|
case Rec_FORM_SIGN_UP: // I want to apply for enrollment
|
||||||
|
DefaultRoleInCurrentCrs = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)) ? Rol_ROLE_TEACHER :
|
||||||
|
Rol_ROLE_STUDENT;
|
||||||
|
fprintf (Gbl.F.Out,"<select name=\"Role\">");
|
||||||
|
for (Role = Rol_ROLE_STUDENT;
|
||||||
|
Role <= Rol_ROLE_TEACHER;
|
||||||
|
Role++)
|
||||||
|
{
|
||||||
|
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Role);
|
||||||
|
if (Role == DefaultRoleInCurrentCrs)
|
||||||
|
fprintf (Gbl.F.Out," selected=\"selected\"");
|
||||||
|
fprintf (Gbl.F.Out,">%s</option>",
|
||||||
|
Txt_ROLES_SINGULAR_Abc[Role][UsrDat->Sex]);
|
||||||
|
}
|
||||||
|
fprintf (Gbl.F.Out,"</select>");
|
||||||
|
break;
|
||||||
|
case Rec_FORM_MY_COMMON_RECORD: // It's me, change my data
|
||||||
|
for (Sex = Usr_SEX_FEMALE;
|
||||||
|
Sex <= Usr_SEX_MALE;
|
||||||
|
Sex++)
|
||||||
|
{
|
||||||
|
fprintf (Gbl.F.Out,"<input type=\"radio\" name=\"Sex\" value=\"%u\"",(unsigned) Sex);
|
||||||
|
if (Sex == Gbl.Usrs.Me.UsrDat.Sex)
|
||||||
|
fprintf (Gbl.F.Out," checked=\"checked\"");
|
||||||
|
fprintf (Gbl.F.Out," /><img src=\"%s/%s16x16.gif\" alt=\"%s\""
|
||||||
|
" class=\"ICON16x16\""
|
||||||
|
" style=\"vertical-align:bottom;\" />%s",
|
||||||
|
Gbl.Prefs.IconsURL,Usr_StringsSexDB[Sex],
|
||||||
|
Txt_SEX_SINGULAR_Abc[Sex],
|
||||||
|
Txt_SEX_SINGULAR_Abc[Sex]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Rec_FORM_MODIFY_RECORD_OTHER_EXISTING_USR: // The other user already exists in the platform
|
||||||
|
if (UsrDat->RoleInCurrentCrsDB < Rol_ROLE_STUDENT) // The other user does not belong to current course
|
||||||
|
{
|
||||||
|
/* If there is a request of this user, default role is the requested role */
|
||||||
|
if ((DefaultRoleInCurrentCrs = Rol_GetRequestedRole (UsrDat->UsrCod)) == Rol_ROLE_UNKNOWN)
|
||||||
|
DefaultRoleInCurrentCrs = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)) ? Rol_ROLE_TEACHER :
|
||||||
|
Rol_ROLE_STUDENT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
DefaultRoleInCurrentCrs = UsrDat->RoleInCurrentCrsDB;
|
||||||
|
|
||||||
|
fprintf (Gbl.F.Out,"<select name=\"Role\">");
|
||||||
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
|
{
|
||||||
|
case Rol_ROLE_GUEST__:
|
||||||
|
case Rol_ROLE_VISITOR:
|
||||||
|
case Rol_ROLE_STUDENT:
|
||||||
|
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\" disabled=\"disabled\">%s</option>",
|
||||||
|
(unsigned) Gbl.Usrs.Me.LoggedRole,
|
||||||
|
Txt_ROLES_SINGULAR_Abc[Gbl.Usrs.Me.LoggedRole][UsrDat->Sex]);
|
||||||
|
break;
|
||||||
|
case Rol_ROLE_TEACHER:
|
||||||
|
for (Role = Rol_ROLE_STUDENT;
|
||||||
|
Role <= Rol_ROLE_TEACHER;
|
||||||
|
Role++)
|
||||||
|
if (Role == Rol_ROLE_STUDENT ||
|
||||||
|
(UsrDat->Roles & (1 << Role))) // A teacher can not upgrade a student (in all other courses) to teacher
|
||||||
|
{
|
||||||
|
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Role);
|
||||||
|
if (Role == DefaultRoleInCurrentCrs)
|
||||||
|
fprintf (Gbl.F.Out," selected=\"selected\"");
|
||||||
|
fprintf (Gbl.F.Out,">%s</option>",
|
||||||
|
Txt_ROLES_SINGULAR_Abc[Role][UsrDat->Sex]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Rol_ROLE_DEG_ADM:
|
||||||
|
case Rol_ROLE_SYS_ADM:
|
||||||
|
for (Role = Rol_ROLE_STUDENT;
|
||||||
|
Role <= Rol_ROLE_TEACHER;
|
||||||
|
Role++)
|
||||||
|
{
|
||||||
|
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Role);
|
||||||
|
if (Role == DefaultRoleInCurrentCrs)
|
||||||
|
fprintf (Gbl.F.Out," selected=\"selected\"");
|
||||||
|
fprintf (Gbl.F.Out,">%s</option>",
|
||||||
|
Txt_ROLES_SINGULAR_Abc[Role][UsrDat->Sex]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default: // The rest of users can not register other users
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
fprintf (Gbl.F.Out,"</select>");
|
||||||
|
break;
|
||||||
|
case Rec_FORM_NEW_RECORD_OTHER_NEW_USR: // The other user does not exist in platform
|
||||||
|
fprintf (Gbl.F.Out,"<select name=\"Role\">");
|
||||||
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
|
{
|
||||||
|
case Rol_ROLE_TEACHER: // A teacher only can create students
|
||||||
|
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\">%s</option>",
|
||||||
|
(unsigned) Rol_ROLE_STUDENT,Txt_ROLES_SINGULAR_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN]);
|
||||||
|
break;
|
||||||
|
case Rol_ROLE_DEG_ADM: // An administrator or a superuser can create students and teachers
|
||||||
|
case Rol_ROLE_SYS_ADM:
|
||||||
|
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\">%s</option>"
|
||||||
|
"<option value=\"%u\">%s</option>",
|
||||||
|
(unsigned) Rol_ROLE_STUDENT,Txt_ROLES_SINGULAR_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN],
|
||||||
|
(unsigned) Rol_ROLE_TEACHER,Txt_ROLES_SINGULAR_Abc[Rol_ROLE_TEACHER][Usr_SEX_UNKNOWN]);
|
||||||
|
break;
|
||||||
|
default: // The rest of users can not register other users
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
fprintf (Gbl.F.Out,"</select>");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
"</tr>");
|
||||||
|
}
|
||||||
|
else // RoleForm == false
|
||||||
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
||||||
|
"%s:"
|
||||||
|
"</td>"
|
||||||
|
"<td colspan=\"2\" class=\"%s\""
|
||||||
|
" style=\"width:%upx; text-align:left;\">"
|
||||||
|
"%s"
|
||||||
|
"</td>"
|
||||||
|
"</tr>",
|
||||||
|
ClassForm,Col1Width,
|
||||||
|
TypeOfView == Rec_MY_COMMON_RECORD_CHECK ? Txt_Sex :
|
||||||
|
Txt_Role,
|
||||||
|
ClassData,Col2Width,
|
||||||
|
TypeOfView == Rec_MY_COMMON_RECORD_CHECK ? Txt_SEX_SINGULAR_Abc[UsrDat->Sex] :
|
||||||
|
Txt_ROLES_SINGULAR_Abc[UsrDat->RoleInCurrentCrsDB][UsrDat->Sex]);
|
||||||
|
}
|
||||||
|
|
||||||
/***** Name *****/
|
/***** Name *****/
|
||||||
/* Surname 1 */
|
/* Surname 1 */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
||||||
"%s",
|
"%s",
|
||||||
ClassForm,Col1Width,Txt_Surname_1);
|
ClassForm,Col1Width,Txt_Surname_1);
|
||||||
if (TypeOfView == Rec_FORM_MY_COMMON_RECORD)
|
if (TypeOfView == Rec_FORM_MY_COMMON_RECORD)
|
||||||
fprintf (Gbl.F.Out,"*");
|
fprintf (Gbl.F.Out,"*");
|
||||||
fprintf (Gbl.F.Out,":</td>"
|
fprintf (Gbl.F.Out,":</td>"
|
||||||
"<td colspan=\"2\" class=\"%s\""
|
"<td colspan=\"2\" class=\"%s\""
|
||||||
" style=\"width:%upx; text-align:left;\">",
|
" style=\"width:%upx; text-align:left;\">",
|
||||||
ClassData,Cols2and3Width);
|
ClassData,Cols2and3Width);
|
||||||
if (DataForm)
|
if (DataForm)
|
||||||
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"Surname1\""
|
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"Surname1\""
|
||||||
" style=\"width:400px;\" maxlength=\"%u\" value=\"%s\" />",
|
" style=\"width:400px;\" maxlength=\"%u\" value=\"%s\" />",
|
||||||
Usr_MAX_LENGTH_USR_NAME_OR_SURNAME,UsrDat->Surname1);
|
Usr_MAX_LENGTH_USR_NAME_OR_SURNAME,UsrDat->Surname1);
|
||||||
else if (UsrDat->Surname1[0])
|
else if (UsrDat->Surname1[0])
|
||||||
fprintf (Gbl.F.Out,"<strong>%s</strong>",UsrDat->Surname1);
|
fprintf (Gbl.F.Out,"<strong>%s</strong>",UsrDat->Surname1);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
/* Surname 2 */
|
/* Surname 2 */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
||||||
"%s:"
|
"%s:"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td colspan=\"2\" class=\"%s\""
|
"<td colspan=\"2\" class=\"%s\""
|
||||||
" style=\"width:%upx; text-align:left;\">",
|
" style=\"width:%upx; text-align:left;\">",
|
||||||
ClassForm,Col1Width,
|
ClassForm,Col1Width,
|
||||||
Txt_Surname_2,
|
Txt_Surname_2,
|
||||||
ClassData,Cols2and3Width);
|
ClassData,Cols2and3Width);
|
||||||
if (DataForm)
|
if (DataForm)
|
||||||
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"Surname2\""
|
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"Surname2\""
|
||||||
" style=\"width:400px;\" maxlength=\"%u\" value=\"%s\" />",
|
" style=\"width:400px;\" maxlength=\"%u\" value=\"%s\" />",
|
||||||
Usr_MAX_LENGTH_USR_NAME_OR_SURNAME,UsrDat->Surname2);
|
Usr_MAX_LENGTH_USR_NAME_OR_SURNAME,UsrDat->Surname2);
|
||||||
else if (UsrDat->Surname2[0])
|
else if (UsrDat->Surname2[0])
|
||||||
fprintf (Gbl.F.Out,"<strong>%s</strong>",
|
fprintf (Gbl.F.Out,"<strong>%s</strong>",
|
||||||
UsrDat->Surname2);
|
UsrDat->Surname2);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
/* First name */
|
/* First name */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
"<td class=\"%s\" style=\"width:%upx; text-align:left;\">"
|
||||||
"%s",
|
"%s",
|
||||||
ClassForm,Col1Width,Txt_First_name);
|
ClassForm,Col1Width,Txt_First_name);
|
||||||
if (TypeOfView == Rec_FORM_MY_COMMON_RECORD)
|
if (TypeOfView == Rec_FORM_MY_COMMON_RECORD)
|
||||||
fprintf (Gbl.F.Out,"*");
|
fprintf (Gbl.F.Out,"*");
|
||||||
fprintf (Gbl.F.Out,":</td>"
|
fprintf (Gbl.F.Out,":</td>"
|
||||||
"<td class=\"%s\" colspan=\"2\""
|
"<td class=\"%s\" colspan=\"2\""
|
||||||
" style=\"width:%upx; text-align:left;\">",
|
" style=\"width:%upx; text-align:left;\">",
|
||||||
ClassData,Cols2and3Width);
|
ClassData,Cols2and3Width);
|
||||||
if (DataForm)
|
if (DataForm)
|
||||||
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"FirstName\""
|
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"FirstName\""
|
||||||
" style=\"width:400px;\" maxlength=\"%u\" value=\"%s\" />",
|
" style=\"width:400px;\" maxlength=\"%u\" value=\"%s\" />",
|
||||||
Usr_MAX_LENGTH_USR_NAME_OR_SURNAME,UsrDat->FirstName);
|
Usr_MAX_LENGTH_USR_NAME_OR_SURNAME,UsrDat->FirstName);
|
||||||
else if (UsrDat->FirstName[0])
|
else if (UsrDat->FirstName[0])
|
||||||
fprintf (Gbl.F.Out,"<strong>%s</strong>",UsrDat->FirstName);
|
fprintf (Gbl.F.Out,"<strong>%s</strong>",UsrDat->FirstName);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
if (TypeOfView == Rec_FORM_MY_COMMON_RECORD ||
|
/* Country */
|
||||||
TypeOfView == Rec_MY_COMMON_RECORD_CHECK ||
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
TypeOfView == Rec_FORM_MY_COURSE_RECORD ||
|
"<td class=\"%s\""
|
||||||
TypeOfView == Rec_MY_COURSE_RECORD_CHECK ||
|
" style=\"width:%upx; text-align:left;\">"
|
||||||
((TypeOfView == Rec_RECORD_LIST ||
|
"%s",
|
||||||
TypeOfView == Rec_RECORD_PRINT) &&
|
ClassForm,Col1Width,Txt_Country);
|
||||||
(IAmTeacher || IAmSuperuser) &&
|
if (TypeOfView == Rec_FORM_MY_COMMON_RECORD)
|
||||||
(UsrDat->RoleInCurrentCrsDB == Rol_ROLE_GUEST__ ||
|
fprintf (Gbl.F.Out,"*");
|
||||||
UsrDat->RoleInCurrentCrsDB == Rol_ROLE_STUDENT)))
|
fprintf (Gbl.F.Out,":</td>"
|
||||||
|
"<td colspan=\"2\" class=\"%s\""
|
||||||
|
" style=\"width:%upx; text-align:left;\">",
|
||||||
|
ClassData,Cols2and3Width);
|
||||||
|
if (ShowData)
|
||||||
{
|
{
|
||||||
/* Country */
|
if (DataForm)
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
|
||||||
"<td class=\"%s\""
|
|
||||||
" style=\"width:%upx; text-align:left;\">"
|
|
||||||
"%s",
|
|
||||||
ClassForm,Col1Width,Txt_Country);
|
|
||||||
if (TypeOfView == Rec_FORM_MY_COMMON_RECORD)
|
|
||||||
fprintf (Gbl.F.Out,"*");
|
|
||||||
fprintf (Gbl.F.Out,":</td>"
|
|
||||||
"<td colspan=\"2\" class=\"%s\""
|
|
||||||
" style=\"width:%upx; text-align:left;\">",
|
|
||||||
ClassData,Cols2and3Width);
|
|
||||||
if (ShowData)
|
|
||||||
{
|
{
|
||||||
if (DataForm)
|
/* If list of countries is empty, try to get it */
|
||||||
|
if (!Gbl.Ctys.Num)
|
||||||
{
|
{
|
||||||
/* If list of countries is empty, try to get it */
|
Gbl.Ctys.SelectedOrderType = Cty_ORDER_BY_COUNTRY;
|
||||||
if (!Gbl.Ctys.Num)
|
Cty_GetListCountries (Cty_GET_ONLY_COUNTRIES);
|
||||||
{
|
}
|
||||||
Gbl.Ctys.SelectedOrderType = Cty_ORDER_BY_COUNTRY;
|
|
||||||
Cty_GetListCountries (Cty_GET_ONLY_COUNTRIES);
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<select name=\"OthCtyCod\" style=\"width:400px;\">"
|
fprintf (Gbl.F.Out,"<select name=\"OthCtyCod\" style=\"width:400px;\">"
|
||||||
"<option value=\"-1\"> </option>"
|
"<option value=\"-1\"> </option>"
|
||||||
"<option value=\"0\"");
|
"<option value=\"0\"");
|
||||||
if (UsrDat->CtyCod == 0)
|
if (UsrDat->CtyCod == 0)
|
||||||
|
fprintf (Gbl.F.Out," selected=\"selected\"");
|
||||||
|
fprintf (Gbl.F.Out,">%s</option>",Txt_Another_country);
|
||||||
|
for (NumCty = 0;
|
||||||
|
NumCty < Gbl.Ctys.Num;
|
||||||
|
NumCty++)
|
||||||
|
{
|
||||||
|
fprintf (Gbl.F.Out,"<option value=\"%ld\"",
|
||||||
|
Gbl.Ctys.Lst[NumCty].CtyCod);
|
||||||
|
if (Gbl.Ctys.Lst[NumCty].CtyCod == UsrDat->CtyCod)
|
||||||
fprintf (Gbl.F.Out," selected=\"selected\"");
|
fprintf (Gbl.F.Out," selected=\"selected\"");
|
||||||
fprintf (Gbl.F.Out,">%s</option>",Txt_Another_country);
|
fprintf (Gbl.F.Out,">%s</option>",
|
||||||
for (NumCty = 0;
|
Gbl.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language]);
|
||||||
NumCty < Gbl.Ctys.Num;
|
|
||||||
NumCty++)
|
|
||||||
{
|
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%ld\"",
|
|
||||||
Gbl.Ctys.Lst[NumCty].CtyCod);
|
|
||||||
if (Gbl.Ctys.Lst[NumCty].CtyCod == UsrDat->CtyCod)
|
|
||||||
fprintf (Gbl.F.Out," selected=\"selected\"");
|
|
||||||
fprintf (Gbl.F.Out,">%s</option>",
|
|
||||||
Gbl.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language]);
|
|
||||||
}
|
|
||||||
fprintf (Gbl.F.Out,"</select>");
|
|
||||||
}
|
|
||||||
else if (UsrDat->CtyCod > 0)
|
|
||||||
{
|
|
||||||
Cty_GetCountryName (UsrDat->CtyCod,CtyName);
|
|
||||||
fprintf (Gbl.F.Out,"%s",CtyName);
|
|
||||||
}
|
}
|
||||||
|
fprintf (Gbl.F.Out,"</select>");
|
||||||
}
|
}
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
else if (UsrDat->CtyCod > 0)
|
||||||
"</tr>");
|
{
|
||||||
|
Cty_GetCountryName (UsrDat->CtyCod,CtyName);
|
||||||
|
fprintf (Gbl.F.Out,"%s",CtyName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
"</tr>");
|
||||||
|
|
||||||
|
if (ShowAddressRows)
|
||||||
|
{
|
||||||
/* Origin place */
|
/* Origin place */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"%s\""
|
"<td class=\"%s\""
|
||||||
|
@ -2850,15 +2862,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Institution, centre, department, office, etc. *****/
|
/***** Institution, centre, department, office, etc. *****/
|
||||||
if (((TypeOfView == Rec_FORM_MY_COMMON_RECORD ||
|
if (ShowTeacherRows)
|
||||||
TypeOfView == Rec_MY_COMMON_RECORD_CHECK ||
|
|
||||||
TypeOfView == Rec_FORM_MY_COURSE_RECORD ||
|
|
||||||
TypeOfView == Rec_MY_COURSE_RECORD_CHECK) &&
|
|
||||||
(UsrDat->Roles & (1 << Rol_ROLE_TEACHER))) || // He/she (me, really) is a teacher in any course
|
|
||||||
((TypeOfView == Rec_RECORD_LIST ||
|
|
||||||
TypeOfView == Rec_RECORD_PRINT) &&
|
|
||||||
(UsrDat->RoleInCurrentCrsDB == Rol_ROLE_GUEST__ ||
|
|
||||||
UsrDat->RoleInCurrentCrsDB == Rol_ROLE_TEACHER))) // He/she is a teacher in the current course
|
|
||||||
{
|
{
|
||||||
/* Institution */
|
/* Institution */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
@ -2972,7 +2976,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
|
|
||||||
/***** End frame *****/
|
/***** End frame *****/
|
||||||
Lay_EndRoundFrameTable10 ();
|
Lay_EndRoundFrameTable10 ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Write a link to netiquette rules ********************/
|
/*********************** Write a link to netiquette rules ********************/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user