mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-13 04:04:35 +02:00
Version19.66.4
This commit is contained in:
parent
9cd0ebed7f
commit
6e2bdbf4aa
|
@ -525,7 +525,7 @@ static void Asg_WriteAssignmentFolder (struct Assignment *Asg,bool PrintView)
|
||||||
break;
|
break;
|
||||||
case Rol_NET:
|
case Rol_NET:
|
||||||
case Rol_TCH:
|
case Rol_TCH:
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -119,7 +119,9 @@ static void Att_PutLinkAttEvent (struct AttendanceEvent *AttEvent,
|
||||||
const char *LinkStyle);
|
const char *LinkStyle);
|
||||||
static void Att_PutParamsCodGrps (long AttCod);
|
static void Att_PutParamsCodGrps (long AttCod);
|
||||||
static void Att_GetNumStdsTotalWhoAreInAttEvent (struct AttendanceEvent *Att);
|
static void Att_GetNumStdsTotalWhoAreInAttEvent (struct AttendanceEvent *Att);
|
||||||
static unsigned Att_GetNumStdsFromAListWhoAreInAttEvent (long AttCod,long LstSelectedUsrCods[],unsigned NumUsrsInList);
|
static unsigned Att_GetNumUsrsFromAListWhoAreInAttEvent (long AttCod,
|
||||||
|
long LstSelectedUsrCods[],
|
||||||
|
unsigned NumUsrsInList);
|
||||||
static bool Att_CheckIfUsrIsInTableAttUsr (long AttCod,long UsrCod,bool *Present);
|
static bool Att_CheckIfUsrIsInTableAttUsr (long AttCod,long UsrCod,bool *Present);
|
||||||
static bool Att_CheckIfUsrIsPresentInAttEvent (long AttCod,long UsrCod);
|
static bool Att_CheckIfUsrIsPresentInAttEvent (long AttCod,long UsrCod);
|
||||||
static bool Att_CheckIfUsrIsPresentInAttEventAndGetComments (long AttCod,long UsrCod,
|
static bool Att_CheckIfUsrIsPresentInAttEventAndGetComments (long AttCod,long UsrCod,
|
||||||
|
@ -2362,7 +2364,7 @@ void Att_RegisterStudentsInAttEvent (void)
|
||||||
|
|
||||||
/***** Free memory *****/
|
/***** Free memory *****/
|
||||||
/* Free memory used by list of selected students' codes */
|
/* Free memory used by list of selected students' codes */
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
|
|
||||||
// 5. Delete from att_usr all the students marked as Remove=true
|
// 5. Delete from att_usr all the students marked as Remove=true
|
||||||
// 6. Replace (insert without duplicated) into att_usr all the students marked as Remove=false
|
// 6. Replace (insert without duplicated) into att_usr all the students marked as Remove=false
|
||||||
|
@ -2432,43 +2434,24 @@ static void Att_GetNumStdsTotalWhoAreInAttEvent (struct AttendanceEvent *Att)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******* Get number of students from a list who attended to an event *********/
|
/********* Get number of users from a list who attended to an event **********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static unsigned Att_GetNumStdsFromAListWhoAreInAttEvent (long AttCod,long LstSelectedUsrCods[],unsigned NumUsrsInList)
|
static unsigned Att_GetNumUsrsFromAListWhoAreInAttEvent (long AttCod,
|
||||||
|
long LstSelectedUsrCods[],
|
||||||
|
unsigned NumUsrsInList)
|
||||||
{
|
{
|
||||||
char *SubQueryAllUsrs = NULL;
|
char *SubQueryAllUsrs;
|
||||||
char SubQueryOneUsr[1 + Cns_MAX_DECIMAL_DIGITS_LONG + 1];
|
unsigned NumUsrsInAttEvent;
|
||||||
unsigned NumUsr;
|
|
||||||
unsigned NumStdsInAttEvent = 0;
|
|
||||||
size_t MaxLength;
|
|
||||||
|
|
||||||
if (NumUsrsInList)
|
if (NumUsrsInList)
|
||||||
{
|
{
|
||||||
/***** Allocate space for subquery *****/
|
/***** Create subquery string *****/
|
||||||
MaxLength = 256 + NumUsrsInList * (1 + Cns_MAX_DECIMAL_DIGITS_LONG);
|
Usr_CreateSubqueryUsrCods (LstSelectedUsrCods,NumUsrsInList,
|
||||||
if ((SubQueryAllUsrs = (char *) malloc (MaxLength + 1)) == NULL)
|
&SubQueryAllUsrs);
|
||||||
Lay_NotEnoughMemoryExit ();
|
|
||||||
SubQueryAllUsrs[0] = '\0';
|
|
||||||
|
|
||||||
/***** Count number of students registered in an event in database *****/
|
/***** Get number of users in attendance event from database ****/
|
||||||
for (NumUsr = 0;
|
NumUsrsInAttEvent =
|
||||||
NumUsr < NumUsrsInList;
|
|
||||||
NumUsr++)
|
|
||||||
if (NumUsr)
|
|
||||||
{
|
|
||||||
snprintf (SubQueryOneUsr,sizeof (SubQueryOneUsr),
|
|
||||||
",%ld",
|
|
||||||
LstSelectedUsrCods[NumUsr]);
|
|
||||||
Str_Concat (SubQueryAllUsrs,SubQueryOneUsr,
|
|
||||||
MaxLength);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
snprintf (SubQueryAllUsrs,sizeof (SubQueryOneUsr),
|
|
||||||
"%ld",
|
|
||||||
LstSelectedUsrCods[NumUsr]);
|
|
||||||
|
|
||||||
NumStdsInAttEvent =
|
|
||||||
(unsigned) DB_QueryCOUNT ("can not get number of students"
|
(unsigned) DB_QueryCOUNT ("can not get number of students"
|
||||||
" from a list who are registered in an event",
|
" from a list who are registered in an event",
|
||||||
"SELECT COUNT(*) FROM att_usr"
|
"SELECT COUNT(*) FROM att_usr"
|
||||||
|
@ -2477,9 +2460,12 @@ static unsigned Att_GetNumStdsFromAListWhoAreInAttEvent (long AttCod,long LstSel
|
||||||
AttCod,SubQueryAllUsrs);
|
AttCod,SubQueryAllUsrs);
|
||||||
|
|
||||||
/***** Free memory for subquery string *****/
|
/***** Free memory for subquery string *****/
|
||||||
free (SubQueryAllUsrs);
|
Usr_FreeSubqueryUsrCods (SubQueryAllUsrs);
|
||||||
}
|
}
|
||||||
return NumStdsInAttEvent;
|
else
|
||||||
|
NumUsrsInAttEvent = 0;
|
||||||
|
|
||||||
|
return NumUsrsInAttEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2712,7 +2698,8 @@ static void Usr_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView)
|
||||||
NumAttEvent < Gbl.AttEvents.Num;
|
NumAttEvent < Gbl.AttEvents.Num;
|
||||||
NumAttEvent++)
|
NumAttEvent++)
|
||||||
/* Get number of students in this event */
|
/* Get number of students in this event */
|
||||||
Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList = Att_GetNumStdsFromAListWhoAreInAttEvent (Gbl.AttEvents.Lst[NumAttEvent].AttCod,
|
Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList =
|
||||||
|
Att_GetNumUsrsFromAListWhoAreInAttEvent (Gbl.AttEvents.Lst[NumAttEvent].AttCod,
|
||||||
&Gbl.Usrs.Me.UsrDat.UsrCod,1);
|
&Gbl.Usrs.Me.UsrDat.UsrCod,1);
|
||||||
|
|
||||||
/***** Get list of attendance events selected *****/
|
/***** Get list of attendance events selected *****/
|
||||||
|
@ -2782,7 +2769,7 @@ static void Usr_ListOrPrintUsrsAttendanceCrs (Att_TypeOfView_t TypeOfView)
|
||||||
Usr_GetListsSelectedUsrsCods ();
|
Usr_GetListsSelectedUsrsCods ();
|
||||||
|
|
||||||
/* Check the number of students to list */
|
/* Check the number of students to list */
|
||||||
if ((NumUsrsInList = Usr_CountNumUsrsInListOfSelectedUsrs ()))
|
if ((NumUsrsInList = Usr_CountNumUsrsInListOfSelectedEncryptedUsrCods ()))
|
||||||
{
|
{
|
||||||
/***** Get boolean parameter that indicates if details must be shown *****/
|
/***** Get boolean parameter that indicates if details must be shown *****/
|
||||||
Gbl.AttEvents.ShowDetails = Par_GetParToBool ("ShowDetails");
|
Gbl.AttEvents.ShowDetails = Par_GetParToBool ("ShowDetails");
|
||||||
|
@ -2798,7 +2785,8 @@ static void Usr_ListOrPrintUsrsAttendanceCrs (Att_TypeOfView_t TypeOfView)
|
||||||
NumAttEvent < Gbl.AttEvents.Num;
|
NumAttEvent < Gbl.AttEvents.Num;
|
||||||
NumAttEvent++)
|
NumAttEvent++)
|
||||||
/* Get number of students in this event */
|
/* Get number of students in this event */
|
||||||
Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList = Att_GetNumStdsFromAListWhoAreInAttEvent (Gbl.AttEvents.Lst[NumAttEvent].AttCod,
|
Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList =
|
||||||
|
Att_GetNumUsrsFromAListWhoAreInAttEvent (Gbl.AttEvents.Lst[NumAttEvent].AttCod,
|
||||||
LstSelectedUsrCods,NumUsrsInList);
|
LstSelectedUsrCods,NumUsrsInList);
|
||||||
|
|
||||||
/***** Get list of attendance events selected *****/
|
/***** Get list of attendance events selected *****/
|
||||||
|
@ -2844,7 +2832,7 @@ static void Usr_ListOrPrintUsrsAttendanceCrs (Att_TypeOfView_t TypeOfView)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
|
|
||||||
/***** Free list of attendance events *****/
|
/***** Free list of attendance events *****/
|
||||||
Att_FreeListAttEvents ();
|
Att_FreeListAttEvents ();
|
||||||
|
|
|
@ -487,7 +487,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
||||||
En OpenSWAD:
|
En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 19.66.3 (2019-11-13)"
|
#define Log_PLATFORM_VERSION "SWAD 19.66.4 (2019-11-13)"
|
||||||
#define CSS_FILE "swad19.47.css"
|
#define CSS_FILE "swad19.47.css"
|
||||||
#define JS_FILE "swad19.65.js"
|
#define JS_FILE "swad19.65.js"
|
||||||
/*
|
/*
|
||||||
|
@ -496,7 +496,8 @@ ps2pdf source.ps destination.pdf
|
||||||
// TODO: Importante: filtrar proyectos por usuarios (igual que en trabajos o en asistencia)
|
// TODO: Importante: filtrar proyectos por usuarios (igual que en trabajos o en asistencia)
|
||||||
// TODO: Code refactoring in HTML h1, title, meta, video, p, iframe, input hidden, area
|
// TODO: Code refactoring in HTML h1, title, meta, video, p, iframe, input hidden, area
|
||||||
|
|
||||||
Version 19.66.4: Nov 13, 2019 Filter projects by selected users. (? lines)
|
Version 19.66.5: Nov 13, 2019 Filter projects by selected users. (? lines)
|
||||||
|
Version 19.66.4: Nov 13, 2019 Code refactoring in list of users in attendance event. (246729 lines)
|
||||||
Version 19.66.3: Nov 13, 2019 Filter projects by selected users. Not finished. (246656 lines)
|
Version 19.66.3: Nov 13, 2019 Filter projects by selected users. Not finished. (246656 lines)
|
||||||
Version 19.66.2: Nov 13, 2019 Fixed bug in edition of test question. (246628 lines)
|
Version 19.66.2: Nov 13, 2019 Fixed bug in edition of test question. (246628 lines)
|
||||||
Version 19.66.1: Nov 13, 2019 Filter projects by selected users. Not finished. (246627 lines)
|
Version 19.66.1: Nov 13, 2019 Filter projects by selected users. Not finished. (246627 lines)
|
||||||
|
|
|
@ -1103,7 +1103,7 @@ static void Fol_RequestFollowUsrs (Act_Action_t NextAction)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fol_RequestUnfollowStds (void)
|
void Fol_RequestUnfollowStds (void)
|
||||||
|
@ -1147,7 +1147,7 @@ static void Fol_RequestUnfollowUsrs (Act_Action_t NextAction)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1239,7 +1239,7 @@ void Fol_FollowUsrs ()
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
|
|
||||||
/***** Show alert *****/
|
/***** Show alert *****/
|
||||||
if (NumFollowed == 1)
|
if (NumFollowed == 1)
|
||||||
|
@ -1286,7 +1286,7 @@ void Fol_UnfollowUsrs (void)
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
|
|
||||||
/***** Show alert *****/
|
/***** Show alert *****/
|
||||||
if (NumUnfollowed == 1)
|
if (NumUnfollowed == 1)
|
||||||
|
|
|
@ -466,7 +466,7 @@ void Gbl_Cleanup (void)
|
||||||
Usr_FreeUsrsList (Role);
|
Usr_FreeUsrsList (Role);
|
||||||
|
|
||||||
Usr_FreeListOtherRecipients ();
|
Usr_FreeListOtherRecipients ();
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
Syl_FreeListItemsSyllabus ();
|
Syl_FreeListItemsSyllabus ();
|
||||||
Tst_FreeTagsList ();
|
Tst_FreeTagsList ();
|
||||||
Exa_FreeMemExamAnnouncement ();
|
Exa_FreeMemExamAnnouncement ();
|
||||||
|
|
|
@ -250,7 +250,7 @@ void McR_SelUsrsToViewUsrsMchResults (void)
|
||||||
Usr_FreeUsrsList (Rol_STD);
|
Usr_FreeUsrsList (Rol_STD);
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
|
|
||||||
/***** Free memory for list of selected groups *****/
|
/***** Free memory for list of selected groups *****/
|
||||||
Grp_FreeListCodSelectedGrps ();
|
Grp_FreeListCodSelectedGrps ();
|
||||||
|
@ -274,7 +274,7 @@ void McR_ShowUsrsMchResults (void)
|
||||||
Dat_GetIniEndDatesFromForm ();
|
Dat_GetIniEndDatesFromForm ();
|
||||||
|
|
||||||
/***** Check the number of users whose matches results will be shown *****/
|
/***** Check the number of users whose matches results will be shown *****/
|
||||||
if (Usr_CountNumUsrsInListOfSelectedUsrs ()) // If some users are selected...
|
if (Usr_CountNumUsrsInListOfSelectedEncryptedUsrCods ()) // If some users are selected...
|
||||||
{
|
{
|
||||||
/***** Begin box and table *****/
|
/***** Begin box and table *****/
|
||||||
Box_StartBoxTable (NULL,Txt_Results,NULL,
|
Box_StartBoxTable (NULL,Txt_Results,NULL,
|
||||||
|
@ -308,7 +308,7 @@ void McR_ShowUsrsMchResults (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -350,7 +350,7 @@ static void Msg_PutFormMsgUsrs (char Content[Cns_MAX_BYTES_LONG_TEXT + 1])
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
|
|
||||||
/***** Free memory for list of selected groups *****/
|
/***** Free memory for list of selected groups *****/
|
||||||
Grp_FreeListCodSelectedGrps ();
|
Grp_FreeListCodSelectedGrps ();
|
||||||
|
@ -728,7 +728,7 @@ void Msg_RecMsgFromUsr (void)
|
||||||
Error = Usr_GetListMsgRecipientsWrittenExplicitelyBySender (true);
|
Error = Usr_GetListMsgRecipientsWrittenExplicitelyBySender (true);
|
||||||
|
|
||||||
/***** Check number of recipients *****/
|
/***** Check number of recipients *****/
|
||||||
if ((NumRecipients = Usr_CountNumUsrsInListOfSelectedUsrs ()))
|
if ((NumRecipients = Usr_CountNumUsrsInListOfSelectedEncryptedUsrCods ()))
|
||||||
{
|
{
|
||||||
if (Gbl.Usrs.Me.Role.Logged == Rol_STD &&
|
if (Gbl.Usrs.Me.Role.Logged == Rol_STD &&
|
||||||
NumRecipients > Cfg_MAX_RECIPIENTS)
|
NumRecipients > Cfg_MAX_RECIPIENTS)
|
||||||
|
@ -847,7 +847,7 @@ void Msg_RecMsgFromUsr (void)
|
||||||
/***** Free memory *****/
|
/***** Free memory *****/
|
||||||
/* Free memory used for list of users */
|
/* Free memory used for list of users */
|
||||||
Usr_FreeListOtherRecipients ();
|
Usr_FreeListOtherRecipients ();
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
|
|
||||||
/***** Update received message setting Replied field to true *****/
|
/***** Update received message setting Replied field to true *****/
|
||||||
if (Replied)
|
if (Replied)
|
||||||
|
|
|
@ -125,7 +125,6 @@ struct Prj_Faults
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Prj_ReqListUsrsToSelect (void);
|
static void Prj_ReqListUsrsToSelect (void);
|
||||||
static void Prj_GetListSelectedUsrCods (unsigned NumUsrsInList,long **LstSelectedUsrCods);
|
|
||||||
|
|
||||||
static void Prj_ShowProjectsInCurrentPage (void);
|
static void Prj_ShowProjectsInCurrentPage (void);
|
||||||
|
|
||||||
|
@ -278,38 +277,6 @@ static void Prj_ReqListUsrsToSelect (void)
|
||||||
Txt_View_projects);
|
Txt_View_projects);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/************* Get list of users selected to show their projects *************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void Prj_GetListSelectedUsrCods (unsigned NumUsrsInList,long **LstSelectedUsrCods)
|
|
||||||
{
|
|
||||||
unsigned NumUsr;
|
|
||||||
const char *Ptr;
|
|
||||||
struct UsrData UsrDat;
|
|
||||||
|
|
||||||
/***** Create list of user codes *****/
|
|
||||||
if ((*LstSelectedUsrCods = (long *) calloc ((size_t) NumUsrsInList,sizeof (long))) == NULL)
|
|
||||||
Lay_NotEnoughMemoryExit ();
|
|
||||||
|
|
||||||
/***** Initialize structure with user's data *****/
|
|
||||||
Usr_UsrDataConstructor (&UsrDat);
|
|
||||||
|
|
||||||
/***** Loop over the list Gbl.Usrs.Selected.List[Rol_UNK] getting users' codes *****/
|
|
||||||
for (NumUsr = 0, Ptr = Gbl.Usrs.Selected.List[Rol_UNK];
|
|
||||||
NumUsr < NumUsrsInList && *Ptr;
|
|
||||||
NumUsr++)
|
|
||||||
{
|
|
||||||
Par_GetNextStrUntilSeparParamMult (&Ptr,UsrDat.EncryptedUsrCod,
|
|
||||||
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
|
|
||||||
Usr_GetUsrCodFromEncryptedUsrCod (&UsrDat);
|
|
||||||
(*LstSelectedUsrCods)[NumUsr] = UsrDat.UsrCod;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Free memory used for user's data *****/
|
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************** Show selected projects in a table ********************/
|
/********************** Show selected projects in a table ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2691,13 +2658,11 @@ static void Prj_GetListProjects (void)
|
||||||
|
|
||||||
/***** Get list of selected users' codes if not already got *****/
|
/***** Get list of selected users' codes if not already got *****/
|
||||||
Usr_GetListsSelectedUsrsCods ();
|
Usr_GetListsSelectedUsrsCods ();
|
||||||
NumUsrsInList = Usr_CountNumUsrsInListOfSelectedUsrs ();
|
NumUsrsInList = Usr_CountNumUsrsInListOfSelectedEncryptedUsrCods ();
|
||||||
|
|
||||||
/***** Get list of users selected to show their projects *****/
|
/***** Get list of users selected to show their projects *****/
|
||||||
if (NumUsrsInList)
|
if (NumUsrsInList)
|
||||||
Prj_GetListSelectedUsrCods (NumUsrsInList,&LstSelectedUsrCods);
|
Usr_GetListSelectedUsrCods (NumUsrsInList,&LstSelectedUsrCods);
|
||||||
|
|
||||||
// TODO: Filter by selected users if any
|
|
||||||
|
|
||||||
/***** Get list of projects from database *****/
|
/***** Get list of projects from database *****/
|
||||||
if (Gbl.Prjs.LstIsRead)
|
if (Gbl.Prjs.LstIsRead)
|
||||||
|
@ -2808,6 +2773,41 @@ static void Prj_GetListProjects (void)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Usr_WHO_SELECTED:
|
case Usr_WHO_SELECTED:
|
||||||
|
switch (Gbl.Prjs.SelectedOrder)
|
||||||
|
{
|
||||||
|
case Prj_ORDER_START_TIME:
|
||||||
|
case Prj_ORDER_END_TIME:
|
||||||
|
case Prj_ORDER_TITLE:
|
||||||
|
NumRows = DB_QuerySELECT (&mysql_res,"can not get projects",
|
||||||
|
"SELECT projects.PrjCod"
|
||||||
|
" FROM projects,prj_usr"
|
||||||
|
" WHERE projects.CrsCod=%ld"
|
||||||
|
"%s%s%s"
|
||||||
|
" AND projects.PrjCod=prj_usr.PrjCod"
|
||||||
|
" AND prj_usr.UsrCod=%ld"
|
||||||
|
" ORDER BY %s",
|
||||||
|
Gbl.Hierarchy.Crs.CrsCod,
|
||||||
|
PreNonSubQuery,HidVisSubQuery,DptCodSubQuery,
|
||||||
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
|
OrderBySubQuery[Gbl.Prjs.SelectedOrder]);
|
||||||
|
break;
|
||||||
|
case Prj_ORDER_DEPARTMENT:
|
||||||
|
NumRows = DB_QuerySELECT (&mysql_res,"can not get projects",
|
||||||
|
"SELECT projects.PrjCod"
|
||||||
|
" FROM prj_usr,projects LEFT JOIN departments"
|
||||||
|
" ON projects.DptCod=departments.DptCod"
|
||||||
|
" WHERE projects.CrsCod=%ld"
|
||||||
|
"%s%s%s"
|
||||||
|
" AND projects.PrjCod=prj_usr.PrjCod"
|
||||||
|
" AND prj_usr.UsrCod=%ld"
|
||||||
|
" ORDER BY %s",
|
||||||
|
Gbl.Hierarchy.Crs.CrsCod,
|
||||||
|
PreNonSubQuery,HidVisSubQuery,DptCodSubQuery,
|
||||||
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
|
OrderBySubQuery[Gbl.Prjs.SelectedOrder]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case Usr_WHO_ALL:
|
case Usr_WHO_ALL:
|
||||||
switch (Gbl.Prjs.SelectedOrder)
|
switch (Gbl.Prjs.SelectedOrder)
|
||||||
{
|
{
|
||||||
|
@ -2894,10 +2894,10 @@ static void Prj_GetListProjects (void)
|
||||||
|
|
||||||
/***** Free list of user codes *****/
|
/***** Free list of user codes *****/
|
||||||
if (NumUsrsInList)
|
if (NumUsrsInList)
|
||||||
free (LstSelectedUsrCods);
|
Usr_FreeListSelectedUsrCods (LstSelectedUsrCods);
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -1035,7 +1035,7 @@ static void Rec_ListRecordsGsts (Rec_SharedRecordViewType_t TypeOfView)
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1080,7 +1080,7 @@ static void Rec_ShowRecordOneStdCrs (void)
|
||||||
Frm_StartForm (ActPrnRecSevStd);
|
Frm_StartForm (ActPrnRecSevStd);
|
||||||
Usr_CreateListSelectedUsrsCodsAndFillWithOtherUsr ();
|
Usr_CreateListSelectedUsrsCodsAndFillWithOtherUsr ();
|
||||||
Usr_PutHiddenParSelectedUsrsCods ();
|
Usr_PutHiddenParSelectedUsrsCods ();
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
Rec_ShowLinkToPrintPreviewOfRecords ();
|
Rec_ShowLinkToPrintPreviewOfRecords ();
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
|
||||||
|
@ -1259,7 +1259,7 @@ static void Rec_ListRecordsStds (Rec_SharedRecordViewType_t ShaTypeOfView,
|
||||||
Rec_FreeListFields ();
|
Rec_FreeListFields ();
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1312,7 +1312,7 @@ static void Rec_ShowRecordOneTchCrs (void)
|
||||||
Frm_StartForm (ActPrnRecSevTch);
|
Frm_StartForm (ActPrnRecSevTch);
|
||||||
Usr_CreateListSelectedUsrsCodsAndFillWithOtherUsr ();
|
Usr_CreateListSelectedUsrsCodsAndFillWithOtherUsr ();
|
||||||
Usr_PutHiddenParSelectedUsrsCods ();
|
Usr_PutHiddenParSelectedUsrsCods ();
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
Par_PutHiddenParamChar ("ParamOfficeHours",'Y');
|
Par_PutHiddenParamChar ("ParamOfficeHours",'Y');
|
||||||
Par_PutHiddenParamChar ("ShowOfficeHours",ShowOfficeHours ? 'Y' :
|
Par_PutHiddenParamChar ("ShowOfficeHours",ShowOfficeHours ? 'Y' :
|
||||||
'N');
|
'N');
|
||||||
|
@ -1474,7 +1474,7 @@ static void Rec_ListRecordsTchs (Rec_SharedRecordViewType_t TypeOfView)
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -916,11 +916,11 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
|
||||||
HTM_SECTION_Begin (Sta_STAT_RESULTS_SECTION_ID);
|
HTM_SECTION_Begin (Sta_STAT_RESULTS_SECTION_ID);
|
||||||
|
|
||||||
/***** Check selection *****/
|
/***** Check selection *****/
|
||||||
if (!Usr_CountNumUsrsInListOfSelectedUsrs ()) // Error: there are no users selected
|
if (!Usr_CountNumUsrsInListOfSelectedEncryptedUsrCods ()) // Error: there are no users selected
|
||||||
{
|
{
|
||||||
/* Write warning message, clean and abort */
|
/* Write warning message, clean and abort */
|
||||||
Ale_ShowAlert (Ale_WARNING,Txt_You_must_select_one_ore_more_users);
|
Ale_ShowAlert (Ale_WARNING,Txt_You_must_select_one_ore_more_users);
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1495,7 +1495,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
if (Gbl.Action.Act == ActSeeAccCrs)
|
if (Gbl.Action.Act == ActSeeAccCrs)
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
|
|
||||||
/***** Write time zone used in the calculation of these statistics *****/
|
/***** Write time zone used in the calculation of these statistics *****/
|
||||||
switch (Gbl.Stat.ClicksGroupedBy)
|
switch (Gbl.Stat.ClicksGroupedBy)
|
||||||
|
|
|
@ -7532,7 +7532,7 @@ void Tst_SelUsrsToViewUsrsTstResults (void)
|
||||||
Usr_FreeUsrsList (Rol_STD);
|
Usr_FreeUsrsList (Rol_STD);
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
|
|
||||||
/***** Free memory for list of selected groups *****/
|
/***** Free memory for list of selected groups *****/
|
||||||
Grp_FreeListCodSelectedGrps ();
|
Grp_FreeListCodSelectedGrps ();
|
||||||
|
@ -7646,7 +7646,7 @@ void Tst_ShowUsrsTstResults (void)
|
||||||
Dat_GetIniEndDatesFromForm ();
|
Dat_GetIniEndDatesFromForm ();
|
||||||
|
|
||||||
/***** Check the number of users whose tests results will be shown *****/
|
/***** Check the number of users whose tests results will be shown *****/
|
||||||
if (Usr_CountNumUsrsInListOfSelectedUsrs ()) // If some users are selected...
|
if (Usr_CountNumUsrsInListOfSelectedEncryptedUsrCods ()) // If some users are selected...
|
||||||
{
|
{
|
||||||
/***** Begin box and table *****/
|
/***** Begin box and table *****/
|
||||||
Box_StartBoxTable (NULL,Txt_Results,NULL,
|
Box_StartBoxTable (NULL,Txt_Results,NULL,
|
||||||
|
@ -7680,7 +7680,7 @@ void Tst_ShowUsrsTstResults (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
107
swad_user.c
107
swad_user.c
|
@ -205,7 +205,7 @@ static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs,
|
||||||
const char *OnSubmit);
|
const char *OnSubmit);
|
||||||
static void Usr_PutParamsConfirmIWantToSeeBigList (void);
|
static void Usr_PutParamsConfirmIWantToSeeBigList (void);
|
||||||
|
|
||||||
static void Usr_AllocateListSelectedUsrCod (Rol_Role_t Role);
|
static void Usr_AllocateListSelectedEncryptedUsrCods (Rol_Role_t Role);
|
||||||
static void Usr_AllocateListOtherRecipients (void);
|
static void Usr_AllocateListOtherRecipients (void);
|
||||||
|
|
||||||
static void Usr_FormToSelectUsrListType (void (*FuncParams) (void),
|
static void Usr_FormToSelectUsrListType (void (*FuncParams) (void),
|
||||||
|
@ -5723,7 +5723,7 @@ void Usr_GetListsSelectedUsrsCods (void)
|
||||||
if (!Gbl.Usrs.Selected.Filled) // Get list only if not already got
|
if (!Gbl.Usrs.Selected.Filled) // Get list only if not already got
|
||||||
{
|
{
|
||||||
/***** Get possible list of all selected users *****/
|
/***** Get possible list of all selected users *****/
|
||||||
Usr_AllocateListSelectedUsrCod (Rol_UNK);
|
Usr_AllocateListSelectedEncryptedUsrCods (Rol_UNK);
|
||||||
if (Gbl.Session.IsOpen) // If the session is open, get parameter from DB
|
if (Gbl.Session.IsOpen) // If the session is open, get parameter from DB
|
||||||
{
|
{
|
||||||
Ses_GetHiddenParFromDB (Usr_ParamUsrCod[Rol_UNK],Gbl.Usrs.Selected.List[Rol_UNK],
|
Ses_GetHiddenParFromDB (Usr_ParamUsrCod[Rol_UNK],Gbl.Usrs.Selected.List[Rol_UNK],
|
||||||
|
@ -5742,7 +5742,7 @@ void Usr_GetListsSelectedUsrsCods (void)
|
||||||
if (Usr_ParamUsrCod[Role])
|
if (Usr_ParamUsrCod[Role])
|
||||||
{
|
{
|
||||||
/* Get parameter with selected users with this role */
|
/* Get parameter with selected users with this role */
|
||||||
Usr_AllocateListSelectedUsrCod (Role);
|
Usr_AllocateListSelectedEncryptedUsrCods (Role);
|
||||||
Par_GetParMultiToText (Usr_ParamUsrCod[Role],Gbl.Usrs.Selected.List[Role],
|
Par_GetParMultiToText (Usr_ParamUsrCod[Role],Gbl.Usrs.Selected.List[Role],
|
||||||
Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS);
|
Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS);
|
||||||
|
|
||||||
|
@ -5900,7 +5900,7 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
|
||||||
Usr_GetUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS); // Really only EncryptedUsrCod is needed
|
Usr_GetUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS); // Really only EncryptedUsrCod is needed
|
||||||
|
|
||||||
/* Find if encrypted user's code is already in list */
|
/* Find if encrypted user's code is already in list */
|
||||||
if (!Usr_FindUsrCodInListOfSelectedUsrs (UsrDat.EncryptedUsrCod)) // If not in list ==> add it
|
if (!Usr_FindEncryptedUsrCodsInListOfSelectedEncryptedUsrCods (UsrDat.EncryptedUsrCod)) // If not in list ==> add it
|
||||||
{
|
{
|
||||||
LengthUsrCod = strlen (UsrDat.EncryptedUsrCod);
|
LengthUsrCod = strlen (UsrDat.EncryptedUsrCod);
|
||||||
|
|
||||||
|
@ -5951,7 +5951,7 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Returns true if EncryptedUsrCodToFind is in Gbl.Usrs.Selected.List[Rol_UNK]
|
// Returns true if EncryptedUsrCodToFind is in Gbl.Usrs.Selected.List[Rol_UNK]
|
||||||
|
|
||||||
bool Usr_FindUsrCodInListOfSelectedUsrs (const char *EncryptedUsrCodToFind)
|
bool Usr_FindEncryptedUsrCodsInListOfSelectedEncryptedUsrCods (const char *EncryptedUsrCodToFind)
|
||||||
{
|
{
|
||||||
const char *Ptr;
|
const char *Ptr;
|
||||||
char EncryptedUsrCod[Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64 + 1];
|
char EncryptedUsrCod[Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64 + 1];
|
||||||
|
@ -5974,7 +5974,7 @@ bool Usr_FindUsrCodInListOfSelectedUsrs (const char *EncryptedUsrCodToFind)
|
||||||
/************ Count number of valid users' IDs in encrypted list *************/
|
/************ Count number of valid users' IDs in encrypted list *************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
unsigned Usr_CountNumUsrsInListOfSelectedUsrs (void)
|
unsigned Usr_CountNumUsrsInListOfSelectedEncryptedUsrCods (void)
|
||||||
{
|
{
|
||||||
const char *Ptr;
|
const char *Ptr;
|
||||||
unsigned NumUsrs = 0;
|
unsigned NumUsrs = 0;
|
||||||
|
@ -5998,7 +5998,7 @@ unsigned Usr_CountNumUsrsInListOfSelectedUsrs (void)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Role = Rol_UNK here means all users
|
// Role = Rol_UNK here means all users
|
||||||
|
|
||||||
static void Usr_AllocateListSelectedUsrCod (Rol_Role_t Role)
|
static void Usr_AllocateListSelectedEncryptedUsrCods (Rol_Role_t Role)
|
||||||
{
|
{
|
||||||
if (!Gbl.Usrs.Selected.List[Role])
|
if (!Gbl.Usrs.Selected.List[Role])
|
||||||
{
|
{
|
||||||
|
@ -6013,7 +6013,7 @@ static void Usr_AllocateListSelectedUsrCod (Rol_Role_t Role)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Role = Rol_UNK here means all users
|
// Role = Rol_UNK here means all users
|
||||||
|
|
||||||
void Usr_FreeListsSelectedUsrsCods (void)
|
void Usr_FreeListsSelectedEncryptedUsrsCods (void)
|
||||||
{
|
{
|
||||||
Rol_Role_t Role;
|
Rol_Role_t Role;
|
||||||
|
|
||||||
|
@ -6036,6 +6036,89 @@ void Usr_FreeListsSelectedUsrsCods (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************* Get list of users selected to show their projects *************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Usr_GetListSelectedUsrCods (unsigned NumUsrsInList,long **LstSelectedUsrCods)
|
||||||
|
{
|
||||||
|
unsigned NumUsr;
|
||||||
|
const char *Ptr;
|
||||||
|
struct UsrData UsrDat;
|
||||||
|
|
||||||
|
/***** Create list of user codes *****/
|
||||||
|
if ((*LstSelectedUsrCods = (long *) calloc ((size_t) NumUsrsInList,sizeof (long))) == NULL)
|
||||||
|
Lay_NotEnoughMemoryExit ();
|
||||||
|
|
||||||
|
/***** Initialize structure with user's data *****/
|
||||||
|
Usr_UsrDataConstructor (&UsrDat);
|
||||||
|
|
||||||
|
/***** Loop over the list Gbl.Usrs.Selected.List[Rol_UNK] getting users' codes *****/
|
||||||
|
for (NumUsr = 0, Ptr = Gbl.Usrs.Selected.List[Rol_UNK];
|
||||||
|
NumUsr < NumUsrsInList && *Ptr;
|
||||||
|
NumUsr++)
|
||||||
|
{
|
||||||
|
Par_GetNextStrUntilSeparParamMult (&Ptr,UsrDat.EncryptedUsrCod,
|
||||||
|
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
|
||||||
|
Usr_GetUsrCodFromEncryptedUsrCod (&UsrDat);
|
||||||
|
(*LstSelectedUsrCods)[NumUsr] = UsrDat.UsrCod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Free memory used for user's data *****/
|
||||||
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Usr_FreeListSelectedUsrCods (long *LstSelectedUsrCods)
|
||||||
|
{
|
||||||
|
if (LstSelectedUsrCods)
|
||||||
|
free (LstSelectedUsrCods);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/******** Create subquery string with users' codes separated by commas *******/
|
||||||
|
/******** from list of users' codes *******/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Usr_CreateSubqueryUsrCods (long LstSelectedUsrCods[],
|
||||||
|
unsigned NumUsrsInList,
|
||||||
|
char **SubQueryAllUsrs)
|
||||||
|
{
|
||||||
|
char SubQueryOneUsr[1 + Cns_MAX_DECIMAL_DIGITS_LONG + 1];
|
||||||
|
unsigned NumUsr;
|
||||||
|
size_t MaxLength;
|
||||||
|
|
||||||
|
if (NumUsrsInList)
|
||||||
|
{
|
||||||
|
/***** Allocate space for subquery *****/
|
||||||
|
MaxLength = NumUsrsInList * (1 + Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||||
|
if ((*SubQueryAllUsrs = (char *) malloc (MaxLength + 1)) == NULL)
|
||||||
|
Lay_NotEnoughMemoryExit ();
|
||||||
|
(*SubQueryAllUsrs)[0] = '\0';
|
||||||
|
|
||||||
|
/***** Count number of students registered in an event in database *****/
|
||||||
|
for (NumUsr = 0;
|
||||||
|
NumUsr < NumUsrsInList;
|
||||||
|
NumUsr++)
|
||||||
|
if (NumUsr)
|
||||||
|
{
|
||||||
|
snprintf (SubQueryOneUsr,sizeof (SubQueryOneUsr),
|
||||||
|
",%ld",
|
||||||
|
LstSelectedUsrCods[NumUsr]);
|
||||||
|
Str_Concat (*SubQueryAllUsrs,SubQueryOneUsr,
|
||||||
|
MaxLength);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
snprintf (*SubQueryAllUsrs,sizeof (SubQueryOneUsr),
|
||||||
|
"%ld",
|
||||||
|
LstSelectedUsrCods[NumUsr]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Usr_FreeSubqueryUsrCods (char *SubQueryAllUsrs)
|
||||||
|
{
|
||||||
|
free (SubQueryAllUsrs);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********** Allocate memory for list of users's IDs or nicknames *************/
|
/********** Allocate memory for list of users's IDs or nicknames *************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -6254,7 +6337,7 @@ void Usr_GetSelectedUsrsAndGoToAct (void (*FuncWhenUsrsSelected) (),
|
||||||
Usr_GetListsSelectedUsrsCods ();
|
Usr_GetListsSelectedUsrsCods ();
|
||||||
|
|
||||||
/***** Check number of users *****/
|
/***** Check number of users *****/
|
||||||
if (Usr_CountNumUsrsInListOfSelectedUsrs ()) // If some users are selected...
|
if (Usr_CountNumUsrsInListOfSelectedEncryptedUsrCods ()) // If some users are selected...
|
||||||
FuncWhenUsrsSelected ();
|
FuncWhenUsrsSelected ();
|
||||||
else // If no users are selected...
|
else // If no users are selected...
|
||||||
{
|
{
|
||||||
|
@ -6265,7 +6348,7 @@ void Usr_GetSelectedUsrsAndGoToAct (void (*FuncWhenUsrsSelected) (),
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedEncryptedUsrsCods ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -6378,7 +6461,7 @@ static void Usr_PutCheckboxToSelectUser (Rol_Role_t Role,
|
||||||
CheckboxChecked = true;
|
CheckboxChecked = true;
|
||||||
else
|
else
|
||||||
/* Check if user is in lists of selected users */
|
/* Check if user is in lists of selected users */
|
||||||
CheckboxChecked = Usr_FindUsrCodInListOfSelectedUsrs (EncryptedUsrCod);
|
CheckboxChecked = Usr_FindEncryptedUsrCodsInListOfSelectedEncryptedUsrCods (EncryptedUsrCod);
|
||||||
|
|
||||||
/***** Check box *****/
|
/***** Check box *****/
|
||||||
HTM_INPUT_CHECKBOX (Usr_ParamUsrCod[Role],false,
|
HTM_INPUT_CHECKBOX (Usr_ParamUsrCod[Role],false,
|
||||||
|
@ -8371,7 +8454,7 @@ void Usr_DoActionOnSeveralUsrs1 (void)
|
||||||
Usr_GetListsSelectedUsrsCods ();
|
Usr_GetListsSelectedUsrsCods ();
|
||||||
|
|
||||||
/* Check the number of users */
|
/* Check the number of users */
|
||||||
if (!Usr_CountNumUsrsInListOfSelectedUsrs ())// If no users selected...
|
if (!Usr_CountNumUsrsInListOfSelectedEncryptedUsrCods ())// If no users selected...
|
||||||
{ // ...write warning notice
|
{ // ...write warning notice
|
||||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||||
Txt_You_must_select_one_ore_more_users);
|
Txt_You_must_select_one_ore_more_users);
|
||||||
|
|
16
swad_user.h
16
swad_user.h
|
@ -432,9 +432,19 @@ void Usr_PutHiddenParSelectedUsrsCods (void);
|
||||||
void Usr_CreateListSelectedUsrsCodsAndFillWithOtherUsr (void);
|
void Usr_CreateListSelectedUsrsCodsAndFillWithOtherUsr (void);
|
||||||
void Usr_GetListsSelectedUsrsCods (void);
|
void Usr_GetListsSelectedUsrsCods (void);
|
||||||
bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs);
|
bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs);
|
||||||
bool Usr_FindUsrCodInListOfSelectedUsrs (const char *EncryptedUsrCodToFind);
|
|
||||||
unsigned Usr_CountNumUsrsInListOfSelectedUsrs (void);
|
bool Usr_FindEncryptedUsrCodsInListOfSelectedEncryptedUsrCods (const char *EncryptedUsrCodToFind);
|
||||||
void Usr_FreeListsSelectedUsrsCods (void);
|
unsigned Usr_CountNumUsrsInListOfSelectedEncryptedUsrCods (void);
|
||||||
|
void Usr_FreeListsSelectedEncryptedUsrsCods (void);
|
||||||
|
|
||||||
|
void Usr_GetListSelectedUsrCods (unsigned NumUsrsInList,long **LstSelectedUsrCods);
|
||||||
|
void Usr_FreeListSelectedUsrCods (long *LstSelectedUsrCods);
|
||||||
|
|
||||||
|
void Usr_CreateSubqueryUsrCods (long LstSelectedUsrCods[],
|
||||||
|
unsigned NumUsrsInList,
|
||||||
|
char **SubQueryAllUsrs);
|
||||||
|
void Usr_FreeSubqueryUsrCods (char *SubQueryAllUsrs);
|
||||||
|
|
||||||
void Usr_FreeListOtherRecipients (void);
|
void Usr_FreeListOtherRecipients (void);
|
||||||
|
|
||||||
void Usr_ShowFormsToSelectUsrListType (void (*FuncParams) (void));
|
void Usr_ShowFormsToSelectUsrListType (void (*FuncParams) (void));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user