mirror of https://github.com/acanas/swad-core.git
Version 15.161
This commit is contained in:
parent
332886a725
commit
c4b9526c72
|
@ -917,6 +917,7 @@ Users:
|
||||||
763. ActRecAttMe Save my comments as student in an attendance event
|
763. ActRecAttMe Save my comments as student in an attendance event
|
||||||
|
|
||||||
764. ActSignUp Apply for my enrollment
|
764. ActSignUp Apply for my enrollment
|
||||||
|
New! 700. ActUpdSignUpReq Update pending requests for inscription in the current course
|
||||||
765. ActReqRejSignUp Ask if reject the enrollment of a user in a course
|
765. ActReqRejSignUp Ask if reject the enrollment of a user in a course
|
||||||
766. ActRejSignUp Reject the enrollment of a user in a course
|
766. ActRejSignUp Reject the enrollment of a user in a course
|
||||||
|
|
||||||
|
@ -2238,6 +2239,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
||||||
/* ActRecAttMe */{1076,-1,TabUsr,ActSeeAtt ,0x008,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Att_RegisterMeAsStdInAttEvent ,NULL},
|
/* ActRecAttMe */{1076,-1,TabUsr,ActSeeAtt ,0x008,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Att_RegisterMeAsStdInAttEvent ,NULL},
|
||||||
|
|
||||||
/* ActSignUp */{1056,-1,TabUsr,ActReqSignUp ,0x000,0x006,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_SignUpInCrs ,NULL},
|
/* ActSignUp */{1056,-1,TabUsr,ActReqSignUp ,0x000,0x006,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_SignUpInCrs ,NULL},
|
||||||
|
/* ActUpdSignUpReq */{1522,-1,TabUsr,ActSeeSignUpReq ,0x1F0,0x1F0,0x1F0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_UpdateEnrollmentRequests ,NULL},
|
||||||
/* ActReqRejSignUp */{1058,-1,TabUsr,ActSeeSignUpReq ,0x1F0,0x1F0,0x1F0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AskIfRejectSignUp ,NULL},
|
/* ActReqRejSignUp */{1058,-1,TabUsr,ActSeeSignUpReq ,0x1F0,0x1F0,0x1F0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AskIfRejectSignUp ,NULL},
|
||||||
/* ActRejSignUp */{1059,-1,TabUsr,ActSeeSignUpReq ,0x1F0,0x1F0,0x1F0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_RejectSignUp ,NULL},
|
/* ActRejSignUp */{1059,-1,TabUsr,ActSeeSignUpReq ,0x1F0,0x1F0,0x1F0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_RejectSignUp ,NULL},
|
||||||
|
|
||||||
|
@ -4235,6 +4237,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
|
||||||
ActUnfSocComUsr, // #1519
|
ActUnfSocComUsr, // #1519
|
||||||
ActSeeSocPrf, // #1520
|
ActSeeSocPrf, // #1520
|
||||||
ActFrmLogIn, // #1521
|
ActFrmLogIn, // #1521
|
||||||
|
ActUpdSignUpReq, // #1522
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
149
swad_action.h
149
swad_action.h
|
@ -71,9 +71,9 @@ typedef enum
|
||||||
|
|
||||||
typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
||||||
|
|
||||||
#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+205+183+143+172+36+27+83)
|
#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+205+183+144+172+36+27+83)
|
||||||
|
|
||||||
#define Act_MAX_ACTION_COD 1521
|
#define Act_MAX_ACTION_COD 1522
|
||||||
|
|
||||||
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 20
|
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 20
|
||||||
|
|
||||||
|
@ -951,89 +951,90 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
|
||||||
#define ActRecAttMe (ActChgNumRowFooGrp+ 70)
|
#define ActRecAttMe (ActChgNumRowFooGrp+ 70)
|
||||||
|
|
||||||
#define ActSignUp (ActChgNumRowFooGrp+ 71)
|
#define ActSignUp (ActChgNumRowFooGrp+ 71)
|
||||||
#define ActReqRejSignUp (ActChgNumRowFooGrp+ 72)
|
#define ActUpdSignUpReq (ActChgNumRowFooGrp+ 72)
|
||||||
#define ActRejSignUp (ActChgNumRowFooGrp+ 73)
|
#define ActReqRejSignUp (ActChgNumRowFooGrp+ 73)
|
||||||
|
#define ActRejSignUp (ActChgNumRowFooGrp+ 74)
|
||||||
|
|
||||||
#define ActReqMdfOneOth (ActChgNumRowFooGrp+ 74)
|
#define ActReqMdfOneOth (ActChgNumRowFooGrp+ 75)
|
||||||
#define ActReqMdfOneStd (ActChgNumRowFooGrp+ 75)
|
#define ActReqMdfOneStd (ActChgNumRowFooGrp+ 76)
|
||||||
#define ActReqMdfOneTch (ActChgNumRowFooGrp+ 76)
|
#define ActReqMdfOneTch (ActChgNumRowFooGrp+ 77)
|
||||||
|
|
||||||
#define ActReqMdfOth (ActChgNumRowFooGrp+ 77)
|
#define ActReqMdfOth (ActChgNumRowFooGrp+ 78)
|
||||||
#define ActReqMdfStd (ActChgNumRowFooGrp+ 78)
|
#define ActReqMdfStd (ActChgNumRowFooGrp+ 79)
|
||||||
#define ActReqMdfTch (ActChgNumRowFooGrp+ 79)
|
#define ActReqMdfTch (ActChgNumRowFooGrp+ 80)
|
||||||
|
|
||||||
#define ActReqOthPho (ActChgNumRowFooGrp+ 80)
|
#define ActReqOthPho (ActChgNumRowFooGrp+ 81)
|
||||||
#define ActReqStdPho (ActChgNumRowFooGrp+ 81)
|
#define ActReqStdPho (ActChgNumRowFooGrp+ 82)
|
||||||
#define ActReqTchPho (ActChgNumRowFooGrp+ 82)
|
#define ActReqTchPho (ActChgNumRowFooGrp+ 83)
|
||||||
#define ActDetOthPho (ActChgNumRowFooGrp+ 83)
|
#define ActDetOthPho (ActChgNumRowFooGrp+ 84)
|
||||||
#define ActDetStdPho (ActChgNumRowFooGrp+ 84)
|
#define ActDetStdPho (ActChgNumRowFooGrp+ 85)
|
||||||
#define ActDetTchPho (ActChgNumRowFooGrp+ 85)
|
#define ActDetTchPho (ActChgNumRowFooGrp+ 86)
|
||||||
#define ActUpdOthPho (ActChgNumRowFooGrp+ 86)
|
#define ActUpdOthPho (ActChgNumRowFooGrp+ 87)
|
||||||
#define ActUpdStdPho (ActChgNumRowFooGrp+ 87)
|
#define ActUpdStdPho (ActChgNumRowFooGrp+ 88)
|
||||||
#define ActUpdTchPho (ActChgNumRowFooGrp+ 88)
|
#define ActUpdTchPho (ActChgNumRowFooGrp+ 89)
|
||||||
#define ActRemOthPho (ActChgNumRowFooGrp+ 89)
|
#define ActRemOthPho (ActChgNumRowFooGrp+ 90)
|
||||||
#define ActRemStdPho (ActChgNumRowFooGrp+ 90)
|
#define ActRemStdPho (ActChgNumRowFooGrp+ 91)
|
||||||
#define ActRemTchPho (ActChgNumRowFooGrp+ 91)
|
#define ActRemTchPho (ActChgNumRowFooGrp+ 92)
|
||||||
#define ActCreOth (ActChgNumRowFooGrp+ 92)
|
#define ActCreOth (ActChgNumRowFooGrp+ 93)
|
||||||
#define ActCreStd (ActChgNumRowFooGrp+ 93)
|
#define ActCreStd (ActChgNumRowFooGrp+ 94)
|
||||||
#define ActCreTch (ActChgNumRowFooGrp+ 94)
|
#define ActCreTch (ActChgNumRowFooGrp+ 95)
|
||||||
#define ActUpdOth (ActChgNumRowFooGrp+ 95)
|
#define ActUpdOth (ActChgNumRowFooGrp+ 96)
|
||||||
#define ActUpdStd (ActChgNumRowFooGrp+ 96)
|
#define ActUpdStd (ActChgNumRowFooGrp+ 97)
|
||||||
#define ActUpdTch (ActChgNumRowFooGrp+ 97)
|
#define ActUpdTch (ActChgNumRowFooGrp+ 98)
|
||||||
|
|
||||||
#define ActReqAccEnrStd (ActChgNumRowFooGrp+ 98)
|
#define ActReqAccEnrStd (ActChgNumRowFooGrp+ 99)
|
||||||
#define ActReqAccEnrTch (ActChgNumRowFooGrp+ 99)
|
#define ActReqAccEnrTch (ActChgNumRowFooGrp+100)
|
||||||
#define ActAccEnrStd (ActChgNumRowFooGrp+100)
|
#define ActAccEnrStd (ActChgNumRowFooGrp+101)
|
||||||
#define ActAccEnrTch (ActChgNumRowFooGrp+101)
|
#define ActAccEnrTch (ActChgNumRowFooGrp+102)
|
||||||
#define ActRemMe_Std (ActChgNumRowFooGrp+102)
|
#define ActRemMe_Std (ActChgNumRowFooGrp+103)
|
||||||
#define ActRemMe_Tch (ActChgNumRowFooGrp+103)
|
#define ActRemMe_Tch (ActChgNumRowFooGrp+104)
|
||||||
|
|
||||||
#define ActNewAdmIns (ActChgNumRowFooGrp+104)
|
#define ActNewAdmIns (ActChgNumRowFooGrp+105)
|
||||||
#define ActRemAdmIns (ActChgNumRowFooGrp+105)
|
#define ActRemAdmIns (ActChgNumRowFooGrp+106)
|
||||||
#define ActNewAdmCtr (ActChgNumRowFooGrp+106)
|
#define ActNewAdmCtr (ActChgNumRowFooGrp+107)
|
||||||
#define ActRemAdmCtr (ActChgNumRowFooGrp+107)
|
#define ActRemAdmCtr (ActChgNumRowFooGrp+108)
|
||||||
#define ActNewAdmDeg (ActChgNumRowFooGrp+108)
|
#define ActNewAdmDeg (ActChgNumRowFooGrp+109)
|
||||||
#define ActRemAdmDeg (ActChgNumRowFooGrp+109)
|
#define ActRemAdmDeg (ActChgNumRowFooGrp+110)
|
||||||
|
|
||||||
#define ActRcvFrmEnrSevStd (ActChgNumRowFooGrp+110)
|
#define ActRcvFrmEnrSevStd (ActChgNumRowFooGrp+111)
|
||||||
#define ActRcvFrmEnrSevTch (ActChgNumRowFooGrp+111)
|
#define ActRcvFrmEnrSevTch (ActChgNumRowFooGrp+112)
|
||||||
|
|
||||||
#define ActFrmIDsOth (ActChgNumRowFooGrp+112)
|
#define ActFrmIDsOth (ActChgNumRowFooGrp+113)
|
||||||
#define ActFrmIDsStd (ActChgNumRowFooGrp+113)
|
#define ActFrmIDsStd (ActChgNumRowFooGrp+114)
|
||||||
#define ActFrmIDsTch (ActChgNumRowFooGrp+114)
|
#define ActFrmIDsTch (ActChgNumRowFooGrp+115)
|
||||||
#define ActRemID_Oth (ActChgNumRowFooGrp+115)
|
#define ActRemID_Oth (ActChgNumRowFooGrp+116)
|
||||||
#define ActRemID_Std (ActChgNumRowFooGrp+116)
|
#define ActRemID_Std (ActChgNumRowFooGrp+117)
|
||||||
#define ActRemID_Tch (ActChgNumRowFooGrp+117)
|
#define ActRemID_Tch (ActChgNumRowFooGrp+118)
|
||||||
#define ActNewID_Oth (ActChgNumRowFooGrp+118)
|
#define ActNewID_Oth (ActChgNumRowFooGrp+119)
|
||||||
#define ActNewID_Std (ActChgNumRowFooGrp+119)
|
#define ActNewID_Std (ActChgNumRowFooGrp+120)
|
||||||
#define ActNewID_Tch (ActChgNumRowFooGrp+120)
|
#define ActNewID_Tch (ActChgNumRowFooGrp+121)
|
||||||
#define ActFrmPwdOth (ActChgNumRowFooGrp+121)
|
#define ActFrmPwdOth (ActChgNumRowFooGrp+122)
|
||||||
#define ActFrmPwdStd (ActChgNumRowFooGrp+122)
|
#define ActFrmPwdStd (ActChgNumRowFooGrp+123)
|
||||||
#define ActFrmPwdTch (ActChgNumRowFooGrp+123)
|
#define ActFrmPwdTch (ActChgNumRowFooGrp+124)
|
||||||
#define ActChgPwdOth (ActChgNumRowFooGrp+124)
|
#define ActChgPwdOth (ActChgNumRowFooGrp+125)
|
||||||
#define ActChgPwdStd (ActChgNumRowFooGrp+125)
|
#define ActChgPwdStd (ActChgNumRowFooGrp+126)
|
||||||
#define ActChgPwdTch (ActChgNumRowFooGrp+126)
|
#define ActChgPwdTch (ActChgNumRowFooGrp+127)
|
||||||
#define ActFrmMaiOth (ActChgNumRowFooGrp+127)
|
#define ActFrmMaiOth (ActChgNumRowFooGrp+128)
|
||||||
#define ActFrmMaiStd (ActChgNumRowFooGrp+128)
|
#define ActFrmMaiStd (ActChgNumRowFooGrp+129)
|
||||||
#define ActFrmMaiTch (ActChgNumRowFooGrp+129)
|
#define ActFrmMaiTch (ActChgNumRowFooGrp+130)
|
||||||
#define ActRemMaiOth (ActChgNumRowFooGrp+130)
|
#define ActRemMaiOth (ActChgNumRowFooGrp+131)
|
||||||
#define ActRemMaiStd (ActChgNumRowFooGrp+131)
|
#define ActRemMaiStd (ActChgNumRowFooGrp+132)
|
||||||
#define ActRemMaiTch (ActChgNumRowFooGrp+132)
|
#define ActRemMaiTch (ActChgNumRowFooGrp+133)
|
||||||
#define ActNewMaiOth (ActChgNumRowFooGrp+133)
|
#define ActNewMaiOth (ActChgNumRowFooGrp+134)
|
||||||
#define ActNewMaiStd (ActChgNumRowFooGrp+134)
|
#define ActNewMaiStd (ActChgNumRowFooGrp+135)
|
||||||
#define ActNewMaiTch (ActChgNumRowFooGrp+135)
|
#define ActNewMaiTch (ActChgNumRowFooGrp+136)
|
||||||
|
|
||||||
#define ActRemStdCrs (ActChgNumRowFooGrp+136)
|
#define ActRemStdCrs (ActChgNumRowFooGrp+137)
|
||||||
#define ActRemTchCrs (ActChgNumRowFooGrp+137)
|
#define ActRemTchCrs (ActChgNumRowFooGrp+138)
|
||||||
#define ActRemUsrGbl (ActChgNumRowFooGrp+138)
|
#define ActRemUsrGbl (ActChgNumRowFooGrp+139)
|
||||||
|
|
||||||
#define ActReqRemAllStdCrs (ActChgNumRowFooGrp+139)
|
#define ActReqRemAllStdCrs (ActChgNumRowFooGrp+140)
|
||||||
#define ActRemAllStdCrs (ActChgNumRowFooGrp+140)
|
#define ActRemAllStdCrs (ActChgNumRowFooGrp+141)
|
||||||
|
|
||||||
#define ActReqRemOldUsr (ActChgNumRowFooGrp+141)
|
#define ActReqRemOldUsr (ActChgNumRowFooGrp+142)
|
||||||
#define ActRemOldUsr (ActChgNumRowFooGrp+142)
|
#define ActRemOldUsr (ActChgNumRowFooGrp+143)
|
||||||
|
|
||||||
#define ActLstClk (ActChgNumRowFooGrp+143)
|
#define ActLstClk (ActChgNumRowFooGrp+144)
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************************** Social tab *********************************/
|
/******************************** Social tab *********************************/
|
||||||
|
|
|
@ -481,7 +481,8 @@ void Ann_ShowFormAnnouncement (void)
|
||||||
1 << Rol_UNKNOWN |
|
1 << Rol_UNKNOWN |
|
||||||
1 << Rol__GUEST_ |
|
1 << Rol__GUEST_ |
|
||||||
1 << Rol_STUDENT |
|
1 << Rol_STUDENT |
|
||||||
1 << Rol_TEACHER);
|
1 << Rol_TEACHER,
|
||||||
|
false);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
|
|
|
@ -137,13 +137,17 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 15.160.4 (2016-03-24)"
|
#define Log_PLATFORM_VERSION "SWAD 15.161 (2016-03-24)"
|
||||||
#define CSS_FILE "swad15.160.2.css"
|
#define CSS_FILE "swad15.160.2.css"
|
||||||
#define JS_FILE "swad15.131.3.js"
|
#define JS_FILE "swad15.131.3.js"
|
||||||
|
|
||||||
// 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 sql/swad*.sql | tail -1
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 15.161: Mar 24, 2016 Changes related to enrollments requests. (196581 lines)
|
||||||
|
1 change necessary in database:
|
||||||
|
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1522','es','N','Actualizar inscripciones pendientes');
|
||||||
|
|
||||||
Version 15.160.4: Mar 24, 2016 Put contextual icon "update" integrated in frame in "Connected users". (196543 lines)
|
Version 15.160.4: Mar 24, 2016 Put contextual icon "update" integrated in frame in "Connected users". (196543 lines)
|
||||||
Version 15.160.3: Mar 24, 2016 Put contextual icon "update" integrated in frame in "Who to follow". (196538 lines)
|
Version 15.160.3: Mar 24, 2016 Put contextual icon "update" integrated in frame in "Who to follow". (196538 lines)
|
||||||
Version 15.160.2: Mar 22, 2016 Changes in layout of tagline. (196512 lines)
|
Version 15.160.2: Mar 22, 2016 Changes in layout of tagline. (196512 lines)
|
||||||
|
|
|
@ -102,6 +102,8 @@ static void Enr_MarkOfficialStdsAsRemovable (long ImpGrpCod,bool RemoveSpecified
|
||||||
|
|
||||||
static void Enr_PutLinkToRemAllStdsThisCrs (void);
|
static void Enr_PutLinkToRemAllStdsThisCrs (void);
|
||||||
|
|
||||||
|
static void Enr_ShowEnrollmentRequestsGivenRoles (unsigned RolesSelected);
|
||||||
|
|
||||||
static void Enr_RemoveEnrollmentRequest (long CrsCod,long UsrCod);
|
static void Enr_RemoveEnrollmentRequest (long CrsCod,long UsrCod);
|
||||||
|
|
||||||
static void Enr_ReqRegRemUsr (Rol_Role_t Role);
|
static void Enr_ReqRegRemUsr (Rol_Role_t Role);
|
||||||
|
@ -2152,6 +2154,46 @@ void Enr_RejectSignUp (void)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Enr_ShowEnrollmentRequests (void)
|
void Enr_ShowEnrollmentRequests (void)
|
||||||
|
{
|
||||||
|
/***** Show enrollment request (default roles depend on my logged role) *****/
|
||||||
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
|
{
|
||||||
|
case Rol_TEACHER:
|
||||||
|
Enr_ShowEnrollmentRequestsGivenRoles ((1 << Rol_STUDENT) |
|
||||||
|
(1 << Rol_TEACHER));
|
||||||
|
break;
|
||||||
|
case Rol_DEG_ADM:
|
||||||
|
case Rol_CTR_ADM:
|
||||||
|
case Rol_INS_ADM:
|
||||||
|
case Rol_SYS_ADM:
|
||||||
|
Enr_ShowEnrollmentRequestsGivenRoles (1 << Rol_TEACHER);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Lay_ShowErrorAndExit ("You don't have permission to list requesters.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/******* Update pending requests for enrollment in the current course ********/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Enr_UpdateEnrollmentRequests (void)
|
||||||
|
{
|
||||||
|
unsigned RolesSelected;
|
||||||
|
|
||||||
|
/***** Get selected roles *****/
|
||||||
|
Rol_GetSelectedRoles (&RolesSelected);
|
||||||
|
|
||||||
|
/***** Update enrollment requests *****/
|
||||||
|
Enr_ShowEnrollmentRequestsGivenRoles (RolesSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************* Show pending requests for enrollment given roles **************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Enr_ShowEnrollmentRequestsGivenRoles (unsigned RolesSelected)
|
||||||
{
|
{
|
||||||
extern const char *The_ClassForm[The_NUM_THEMES];
|
extern const char *The_ClassForm[The_NUM_THEMES];
|
||||||
extern const char *The_ClassFormBold[The_NUM_THEMES];
|
extern const char *The_ClassFormBold[The_NUM_THEMES];
|
||||||
|
@ -2169,7 +2211,6 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
extern const char *Txt_Register;
|
extern const char *Txt_Register;
|
||||||
extern const char *Txt_Reject;
|
extern const char *Txt_Reject;
|
||||||
extern const char *Txt_No_enrollment_requests;
|
extern const char *Txt_No_enrollment_requests;
|
||||||
unsigned RolesSelected;
|
|
||||||
char Query[1024];
|
char Query[1024];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
@ -2190,7 +2231,7 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
|
|
||||||
/***** Selection of scope and roles *****/
|
/***** Selection of scope and roles *****/
|
||||||
/* Start form */
|
/* Start form */
|
||||||
Act_FormStart (ActSeeSignUpReq);
|
Act_FormStart (ActUpdSignUpReq);
|
||||||
fprintf (Gbl.F.Out,"<table style=\"margin:0 auto; border-spacing:5px;\">");
|
fprintf (Gbl.F.Out,"<table style=\"margin:0 auto; border-spacing:5px;\">");
|
||||||
|
|
||||||
/* Scope (whole platform, current centre, current degree or current course) */
|
/* Scope (whole platform, current centre, current degree or current course) */
|
||||||
|
@ -2209,7 +2250,7 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
1 << Sco_SCOPE_CRS;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
Sco_PutSelectorScope (false);
|
Sco_PutSelectorScope (true);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
|
@ -2221,28 +2262,10 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
"<td class=\"DAT LEFT_MIDDLE\">",
|
"<td class=\"DAT LEFT_MIDDLE\">",
|
||||||
The_ClassForm[Gbl.Prefs.Theme],
|
The_ClassForm[Gbl.Prefs.Theme],
|
||||||
Txt_Users);
|
Txt_Users);
|
||||||
Rol_GetSelectedRoles (&RolesSelected);
|
|
||||||
if (!RolesSelected)
|
|
||||||
/* Set default roles */
|
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
|
||||||
{
|
|
||||||
case Rol_TEACHER:
|
|
||||||
RolesSelected = (1 << Rol_STUDENT) |
|
|
||||||
(1 << Rol_TEACHER);
|
|
||||||
break;
|
|
||||||
case Rol_DEG_ADM:
|
|
||||||
case Rol_CTR_ADM:
|
|
||||||
case Rol_INS_ADM:
|
|
||||||
case Rol_SYS_ADM:
|
|
||||||
RolesSelected = (1 << Rol_TEACHER);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Lay_ShowErrorAndExit ("You don't have permission to list requesters.");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Rol_WriteSelectorRoles (1 << Rol_STUDENT |
|
Rol_WriteSelectorRoles (1 << Rol_STUDENT |
|
||||||
1 << Rol_TEACHER,
|
1 << Rol_TEACHER,
|
||||||
RolesSelected);
|
RolesSelected,
|
||||||
|
true);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>"
|
"</tr>"
|
||||||
"</table>");
|
"</table>");
|
||||||
|
|
|
@ -111,6 +111,7 @@ void Enr_GetNotifEnrollmentRequest (char *SummaryStr,char **ContentStr,
|
||||||
void Enr_AskIfRejectSignUp (void);
|
void Enr_AskIfRejectSignUp (void);
|
||||||
void Enr_RejectSignUp (void);
|
void Enr_RejectSignUp (void);
|
||||||
void Enr_ShowEnrollmentRequests (void);
|
void Enr_ShowEnrollmentRequests (void);
|
||||||
|
void Enr_UpdateEnrollmentRequests (void);
|
||||||
|
|
||||||
void Enr_PutLinkToAdminOneUsr (Act_Action_t NextAction);
|
void Enr_PutLinkToAdminOneUsr (Act_Action_t NextAction);
|
||||||
|
|
||||||
|
|
20
swad_role.c
20
swad_role.c
|
@ -342,8 +342,8 @@ void Rol_ChangeMyRole (void)
|
||||||
/********************* Write selector of users' roles ************************/
|
/********************* Write selector of users' roles ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Rol_WriteSelectorRoles (unsigned RolesAllowed,
|
void Rol_WriteSelectorRoles (unsigned RolesAllowed,unsigned RolesSelected,
|
||||||
unsigned RolesSelected)
|
bool SendOnChange)
|
||||||
{
|
{
|
||||||
extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||||
Rol_Role_t Role;
|
Rol_Role_t Role;
|
||||||
|
@ -355,13 +355,29 @@ void Rol_WriteSelectorRoles (unsigned RolesAllowed,
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<input type=\"checkbox\" name=\"Roles\" value=\"%u\"",
|
fprintf (Gbl.F.Out,"<input type=\"checkbox\" name=\"Roles\" value=\"%u\"",
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
|
|
||||||
if ((RolesSelected & (1 << Role)))
|
if ((RolesSelected & (1 << Role)))
|
||||||
fprintf (Gbl.F.Out," checked=\"checked\"");
|
fprintf (Gbl.F.Out," checked=\"checked\"");
|
||||||
|
|
||||||
|
if (SendOnChange)
|
||||||
|
fprintf (Gbl.F.Out," onchange=\"document.getElementById('%s').submit();\"",
|
||||||
|
Gbl.Form.Id);
|
||||||
|
|
||||||
fprintf (Gbl.F.Out," />%s<br />",
|
fprintf (Gbl.F.Out," />%s<br />",
|
||||||
Txt_ROLES_PLURAL_abc[Role][Usr_SEX_UNKNOWN]);
|
Txt_ROLES_PLURAL_abc[Role][Usr_SEX_UNKNOWN]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/******************** Put hidden param with users' roles *********************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Rol_PutHiddenParamRoles (unsigned Role)
|
||||||
|
{
|
||||||
|
fprintf (Gbl.F.Out,"<input type=\"hidden\" name=\"Roles\" value=\"%u\" />",
|
||||||
|
Role);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************* Get selected users' roles *************************/
|
/************************* Get selected users' roles *************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -78,8 +78,9 @@ unsigned Rol_ConvertUnsignedStrToRoles (const char *UnsignedStr);
|
||||||
void Rol_PutFormToChangeMyRole (bool FormInHead);
|
void Rol_PutFormToChangeMyRole (bool FormInHead);
|
||||||
void Rol_ChangeMyRole (void);
|
void Rol_ChangeMyRole (void);
|
||||||
|
|
||||||
void Rol_WriteSelectorRoles (unsigned RolesAllowed,
|
void Rol_WriteSelectorRoles (unsigned RolesAllowed,unsigned RolesSelected,
|
||||||
unsigned RolesSelected);
|
bool SendOnChange);
|
||||||
|
void Rol_PutHiddenParamRoles (unsigned Role);
|
||||||
void Rol_GetSelectedRoles (unsigned *Roles);
|
void Rol_GetSelectedRoles (unsigned *Roles);
|
||||||
|
|
||||||
Rol_Role_t Rol_GetRequestedRole (long UsrCod);
|
Rol_Role_t Rol_GetRequestedRole (long UsrCod);
|
||||||
|
|
|
@ -1604,7 +1604,8 @@ void Svy_RequestCreatOrEditSvy (void)
|
||||||
Txt_Users);
|
Txt_Users);
|
||||||
Rol_WriteSelectorRoles (1 << Rol_STUDENT |
|
Rol_WriteSelectorRoles (1 << Rol_STUDENT |
|
||||||
1 << Rol_TEACHER,
|
1 << Rol_TEACHER,
|
||||||
Svy.Roles);
|
Svy.Roles,
|
||||||
|
false);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue