diff --git a/swad_changelog.h b/swad_changelog.h
index 9228362cb..d7b82776f 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -234,13 +234,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 16.208.4 (2017-05-08)"
+#define Log_PLATFORM_VERSION "SWAD 16.208.5 (2017-05-08)"
#define CSS_FILE "swad16.207.css"
#define JS_FILE "swad16.206.3.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
/*
+ Version 16.208.5: May 09, 2017 Changes in edition of students records. (218750 lines)
Version 16.208.4: May 08, 2017 Changes in edition of students records. (218728 lines)
Version 16.208.3: May 08, 2017 Changes in edition of students records. (218713 lines)
Version 16.208.2: May 08, 2017 Changes in confirmation of user's ID. (218704 lines)
diff --git a/swad_global.h b/swad_global.h
index b390b5f98..662cfc18b 100644
--- a/swad_global.h
+++ b/swad_global.h
@@ -372,10 +372,11 @@ struct Globals
struct ListUsrs LstUsrs[Rol_NUM_ROLES];
struct
{
+ // bool MultipleUsrs; // Listing multiple users?
char *All;
char *Std;
char *Tch;
- } Select; // Lists of ID of users from a form
+ } Select; // Lists of ID of users from a form
char *ListOtherRecipients; // List of ID or nicks of users written explicitely on a form
struct
{
diff --git a/swad_record.c b/swad_record.c
index 562077fdb..ac072f8b7 100644
--- a/swad_record.c
+++ b/swad_record.c
@@ -1086,13 +1086,14 @@ static void Rec_ShowRecordOneStdCrs (void)
/***** Asign users listing type depending on current action *****/
Gbl.Usrs.Listing.RecsUsrs = Rec_RECORD_USERS_STUDENTS;
+ /***** Put contextual links *****/
fprintf (Gbl.F.Out,"
");
+ /***** Show optional alert *****/
+ if (Gbl.Message[0])
+ Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+
/***** Shared record *****/
Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
@@ -1563,11 +1568,15 @@ void Rec_UpdateAndShowMyCrsRecord (void)
void Rec_UpdateAndShowOtherCrsRecord (void)
{
extern const char *Txt_Student_record_card_in_this_course_has_been_updated;
+ bool MultipleUsrs;
/***** Initialize alert type and message *****/
Gbl.AlertType = Lay_INFO; // No error, no success
Gbl.Message[0] = '\0'; // Do not write anything
+ /***** Get parameter indicating if listing multiple users *****/
+ MultipleUsrs = Par_GetParToBool ("MultiUsrs");
+
/***** Get the user whose record we want to modify *****/
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat);
@@ -1583,11 +1592,16 @@ void Rec_UpdateAndShowOtherCrsRecord (void)
/***** Update the record *****/
Rec_UpdateCrsRecord (Gbl.Usrs.Other.UsrDat.UsrCod);
-
- /***** Show records again (including the updated one) *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,"%s",Txt_Student_record_card_in_this_course_has_been_updated);
- Rec_ListRecordsStdsForEdit ();
+
+ /***** Show one or multiple records *****/
+ if (MultipleUsrs)
+ /* Show multiple records again (including the updated one) */
+ Rec_ListRecordsStdsForEdit ();
+ else
+ /* Show only the updated record of this student */
+ Rec_ShowRecordOneStdCrs ();
/***** Free memory used for some fields *****/
Rec_FreeMemFieldsRecordsCrs ();
diff --git a/swad_user.c b/swad_user.c
index 876223f15..34753c36b 100644
--- a/swad_user.c
+++ b/swad_user.c
@@ -5118,6 +5118,10 @@ static void Usr_ShowWarningListIsTooBig (unsigned NumUsrs)
void Usr_PutHiddenParUsrCodAll (Act_Action_t NextAction,const char *ListUsrCods)
{
+ /***** Put a parameter indicating that a list of several users is present *****/
+ Par_PutHiddenParamChar ("MultiUsrs",'Y');
+
+ /***** Put a parameter with the encrypted user codes of several users *****/
if (Gbl.Session.IsOpen)
Ses_InsertHiddenParInDB (NextAction,"UsrCodAll",ListUsrCods);
else
@@ -5140,17 +5144,20 @@ void Usr_GetListsSelectedUsrsCods (void)
/***** Get selected users *****/
if (Gbl.Session.IsOpen) // If the session is open, get parameter from DB
{
- Ses_GetHiddenParFromDB (Gbl.Action.Act,"UsrCodAll",
- Gbl.Usrs.Select.All,Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS);
- Str_ChangeFormat (Str_FROM_FORM,Str_TO_TEXT,
- Gbl.Usrs.Select.All,Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS,true);
+ Ses_GetHiddenParFromDB (Gbl.Action.Act,"UsrCodAll",Gbl.Usrs.Select.All,
+ Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS);
+ Str_ChangeFormat (Str_FROM_FORM,Str_TO_TEXT,Gbl.Usrs.Select.All,
+ Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS,true);
}
else
- Par_GetParMultiToText ("UsrCodAll",Gbl.Usrs.Select.All,Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS);
+ Par_GetParMultiToText ("UsrCodAll",Gbl.Usrs.Select.All,
+ Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS);
- Par_GetParMultiToText ("UsrCodTch",Gbl.Usrs.Select.Tch,Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS); // Teachers or guests
+ Par_GetParMultiToText ("UsrCodTch",Gbl.Usrs.Select.Tch,
+ Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS); // Teachers or guests
- Par_GetParMultiToText ("UsrCodStd",Gbl.Usrs.Select.Std,Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS); // Students
+ Par_GetParMultiToText ("UsrCodStd",Gbl.Usrs.Select.Std,
+ Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS); // Students
/*
sprintf (Gbl.Message,"UsrCodAll = %s / UsrCodTch = %s / UsrCodStd = %s",
Gbl.Usrs.Select.All,Gbl.Usrs.Select.Tch,Gbl.Usrs.Select.Std);
@@ -5160,7 +5167,8 @@ Lay_ShowErrorAndExit (Gbl.Message);
if (Gbl.Usrs.Select.Tch[0])
{
if (Gbl.Usrs.Select.All[0])
- if ((Length = strlen (Gbl.Usrs.Select.All)) < Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS)
+ if ((Length = strlen (Gbl.Usrs.Select.All)) <
+ Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS)
{
Gbl.Usrs.Select.All[Length ] = Par_SEPARATOR_PARAM_MULTIPLE;
Gbl.Usrs.Select.All[Length + 1] = '\0';
@@ -5173,7 +5181,8 @@ Lay_ShowErrorAndExit (Gbl.Message);
if (Gbl.Usrs.Select.Std[0])
{
if (Gbl.Usrs.Select.All[0])
- if ((Length = strlen (Gbl.Usrs.Select.All)) < Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS)
+ if ((Length = strlen (Gbl.Usrs.Select.All)) <
+ Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS)
{
Gbl.Usrs.Select.All[Length ] = Par_SEPARATOR_PARAM_MULTIPLE;
Gbl.Usrs.Select.All[Length + 1] = '\0';