mirror of https://github.com/acanas/swad-core.git
Version 16.208.6
This commit is contained in:
parent
79c2517b39
commit
2cc0cf374e
|
@ -1957,8 +1957,7 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
|
||||||
if (Ctr_CheckIfCtrNameExistsInIns (ParamName,NewCtrName,Ctr->CtrCod,Gbl.CurrentIns.Ins.InsCod))
|
if (Ctr_CheckIfCtrNameExistsInIns (ParamName,NewCtrName,Ctr->CtrCod,Gbl.CurrentIns.Ins.InsCod))
|
||||||
{
|
{
|
||||||
Gbl.AlertType = Lay_WARNING;
|
Gbl.AlertType = Lay_WARNING;
|
||||||
sprintf (Gbl.Message,Txt_The_centre_X_already_exists,
|
sprintf (Gbl.Message,Txt_The_centre_X_already_exists,NewCtrName);
|
||||||
NewCtrName);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -234,13 +234,15 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 16.208.5 (2017-05-08)"
|
#define Log_PLATFORM_VERSION "SWAD 16.208.6 (2017-05-08)"
|
||||||
#define CSS_FILE "swad16.207.css"
|
#define CSS_FILE "swad16.207.css"
|
||||||
#define JS_FILE "swad16.206.3.js"
|
#define JS_FILE "swad16.206.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 16.208.6: May 09, 2017 Changes in alerts.
|
||||||
|
Changes in layout of student records. (218744 lines)
|
||||||
Version 16.208.5: May 09, 2017 Changes in edition of students records. (218750 lines)
|
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.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.3: May 08, 2017 Changes in edition of students records. (218713 lines)
|
||||||
|
|
|
@ -3564,8 +3564,7 @@ void Enr_CreateNewUsr1 (void)
|
||||||
ID_GetParamOtherUsrIDPlain (); // User's ID was already modified and passed as a hidden parameter
|
ID_GetParamOtherUsrIDPlain (); // User's ID was already modified and passed as a hidden parameter
|
||||||
|
|
||||||
/***** Initialize alert type and message *****/
|
/***** Initialize alert type and message *****/
|
||||||
Gbl.AlertType = Lay_INFO; // No error, no success
|
Gbl.AlertType = Lay_NONE; // Do not show alert
|
||||||
Gbl.Message[0] = '\0'; // Do not write anything
|
|
||||||
|
|
||||||
if (ID_CheckIfUsrIDIsValid (Gbl.Usrs.Other.UsrDat.IDs.List[0].ID)) // User's ID valid
|
if (ID_CheckIfUsrIDIsValid (Gbl.Usrs.Other.UsrDat.IDs.List[0].ID)) // User's ID valid
|
||||||
{
|
{
|
||||||
|
@ -3639,9 +3638,8 @@ void Enr_CreateNewUsr2 (void)
|
||||||
{
|
{
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected
|
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected
|
||||||
{
|
{
|
||||||
/***** Show success message *****/
|
/***** Show optional alert *****/
|
||||||
if (Gbl.Message[0])
|
Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
|
||||||
Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
|
|
||||||
|
|
||||||
/***** Change user's groups *****/
|
/***** Change user's groups *****/
|
||||||
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups?
|
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups?
|
||||||
|
@ -3667,8 +3665,7 @@ void Enr_ModifyUsr1 (void)
|
||||||
Rol_Role_t NewRole;
|
Rol_Role_t NewRole;
|
||||||
|
|
||||||
/***** Initialize alert type and message *****/
|
/***** Initialize alert type and message *****/
|
||||||
Gbl.AlertType = Lay_INFO; // No error, no success
|
Gbl.AlertType = Lay_NONE; // Do not show alert
|
||||||
Gbl.Message[0] = '\0'; // Do not write anything
|
|
||||||
|
|
||||||
/***** Get user from form *****/
|
/***** Get user from form *****/
|
||||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||||
|
@ -3709,7 +3706,7 @@ void Enr_ModifyUsr1 (void)
|
||||||
/* Modify role */
|
/* Modify role */
|
||||||
Enr_ModifyRoleInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole);
|
Enr_ModifyRoleInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole);
|
||||||
|
|
||||||
/* Show success message */
|
/* Set success message */
|
||||||
Gbl.AlertType = Lay_SUCCESS;
|
Gbl.AlertType = Lay_SUCCESS;
|
||||||
sprintf (Gbl.Message,Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
|
sprintf (Gbl.Message,Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
|
||||||
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName,
|
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName,
|
||||||
|
@ -3723,7 +3720,7 @@ void Enr_ModifyUsr1 (void)
|
||||||
Enr_RegisterUsrInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole,
|
Enr_RegisterUsrInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole,
|
||||||
Enr_SET_ACCEPTED_TO_FALSE);
|
Enr_SET_ACCEPTED_TO_FALSE);
|
||||||
|
|
||||||
/* Show success message */
|
/* Set success message */
|
||||||
Gbl.AlertType = Lay_SUCCESS;
|
Gbl.AlertType = Lay_SUCCESS;
|
||||||
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_enroled_in_the_course_Y,
|
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_enroled_in_the_course_Y,
|
||||||
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
|
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
|
||||||
|
@ -3796,9 +3793,8 @@ void Enr_ModifyUsr2 (void)
|
||||||
case Enr_REGISTER_MODIFY_ONE_USR_IN_CRS:
|
case Enr_REGISTER_MODIFY_ONE_USR_IN_CRS:
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
|
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
|
||||||
{
|
{
|
||||||
/***** Show success message *****/
|
/***** Show optional alert *****/
|
||||||
if (Gbl.Message[0])
|
Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
|
||||||
Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
|
|
||||||
|
|
||||||
/***** Change user's groups *****/
|
/***** Change user's groups *****/
|
||||||
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups?
|
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups?
|
||||||
|
|
|
@ -117,10 +117,10 @@ void Gbl_InitializeGlobals (void)
|
||||||
Gbl.F.XML = NULL;
|
Gbl.F.XML = NULL;
|
||||||
Gbl.F.Rep = NULL; // Report
|
Gbl.F.Rep = NULL; // Report
|
||||||
|
|
||||||
Gbl.Form.Num = -1; // Number of form. It's increased by 1 at the begin of each form
|
Gbl.Form.Num = -1; // Number of form. It's increased by 1 at the begin of each form
|
||||||
Gbl.Form.Inside = false; // Set to true inside a form to avoid nested forms
|
Gbl.Form.Inside = false; // Set to true inside a form to avoid nested forms
|
||||||
|
|
||||||
Gbl.AlertType = Lay_SUCCESS; // Used to show alert in a posteriori function
|
Gbl.AlertType = Lay_NONE; // Used to show alert in a posteriori function
|
||||||
|
|
||||||
Gbl.DB.DatabaseIsOpen = false;
|
Gbl.DB.DatabaseIsOpen = false;
|
||||||
Gbl.DB.LockedTables = false;
|
Gbl.DB.LockedTables = false;
|
||||||
|
|
|
@ -652,8 +652,7 @@ void Hld_RemoveHoliday1 (void)
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Write message to show the change made *****/
|
||||||
Gbl.AlertType = Lay_SUCCESS;
|
Gbl.AlertType = Lay_SUCCESS;
|
||||||
sprintf (Gbl.Message,Txt_Holiday_X_removed,
|
sprintf (Gbl.Message,Txt_Holiday_X_removed,Hld.Name);
|
||||||
Hld.Name);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,12 +68,13 @@ extern struct Globals Gbl;
|
||||||
|
|
||||||
static const char *Lay_AlertIcons[Lay_NUM_ALERT_TYPES] =
|
static const char *Lay_AlertIcons[Lay_NUM_ALERT_TYPES] =
|
||||||
{
|
{
|
||||||
"info64x64.png",
|
NULL, // Lay_NONE
|
||||||
"success64x64.png",
|
"info64x64.png", // Lay_INFO
|
||||||
"question64x64.gif", // animated
|
"success64x64.png", // Lay_SUCCESS
|
||||||
"warning64x64.gif", // animated
|
"question64x64.gif", // Lay_QUESTION animated gif
|
||||||
"error64x64.gif", // animated
|
"warning64x64.gif", // Lay_WARNING animated gif
|
||||||
"copy_on16x16.gif",
|
"error64x64.gif", // Lay_ERROR animated gif
|
||||||
|
"copy_on16x16.gif", // Lay_CLIPBOARD
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1665,8 +1666,11 @@ void Lay_ShowErrorAndExit (const char *Message)
|
||||||
|
|
||||||
void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Message)
|
void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Message)
|
||||||
{
|
{
|
||||||
Lay_ShowAlertAndButton1 (AlertType,Message);
|
if (AlertType != Lay_NONE)
|
||||||
Lay_ShowAlertAndButton2 (ActUnk,NULL,NULL,Lay_NO_BUTTON,NULL);
|
{
|
||||||
|
Lay_ShowAlertAndButton1 (AlertType,Message);
|
||||||
|
Lay_ShowAlertAndButton2 (ActUnk,NULL,NULL,Lay_NO_BUTTON,NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Message)
|
void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Message)
|
||||||
|
|
|
@ -47,15 +47,16 @@
|
||||||
/********************************* Public types ******************************/
|
/********************************* Public types ******************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Lay_NUM_ALERT_TYPES 6
|
#define Lay_NUM_ALERT_TYPES 7
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
Lay_INFO = 0,
|
Lay_NONE = 0,
|
||||||
Lay_SUCCESS = 1,
|
Lay_INFO = 1,
|
||||||
Lay_QUESTION = 2,
|
Lay_SUCCESS = 2,
|
||||||
Lay_WARNING = 3,
|
Lay_QUESTION = 3,
|
||||||
Lay_ERROR = 4,
|
Lay_WARNING = 4,
|
||||||
Lay_CLIPBOARD = 5,
|
Lay_ERROR = 5,
|
||||||
|
Lay_CLIPBOARD = 6,
|
||||||
} Lay_AlertType_t;
|
} Lay_AlertType_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
|
@ -1102,8 +1102,7 @@ static void Rec_ShowRecordOneStdCrs (void)
|
||||||
fprintf (Gbl.F.Out,"</div>");
|
fprintf (Gbl.F.Out,"</div>");
|
||||||
|
|
||||||
/***** Show optional alert *****/
|
/***** Show optional alert *****/
|
||||||
if (Gbl.Message[0])
|
Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
|
||||||
Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
|
|
||||||
|
|
||||||
/***** Shared record *****/
|
/***** Shared record *****/
|
||||||
Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
|
Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
|
||||||
|
@ -1223,8 +1222,7 @@ static void Rec_ListRecordsStds (Rec_SharedRecordViewType_t ShaTypeOfView,
|
||||||
|
|
||||||
/* Show optional alert */
|
/* Show optional alert */
|
||||||
if (UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod) // Selected user
|
if (UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod) // Selected user
|
||||||
if (Gbl.Message[0])
|
Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
|
||||||
Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
|
|
||||||
|
|
||||||
/* Shared record */
|
/* Shared record */
|
||||||
Rec_ShowSharedUsrRecord (ShaTypeOfView,&UsrDat);
|
Rec_ShowSharedUsrRecord (ShaTypeOfView,&UsrDat);
|
||||||
|
@ -1571,8 +1569,7 @@ void Rec_UpdateAndShowOtherCrsRecord (void)
|
||||||
bool MultipleUsrs;
|
bool MultipleUsrs;
|
||||||
|
|
||||||
/***** Initialize alert type and message *****/
|
/***** Initialize alert type and message *****/
|
||||||
Gbl.AlertType = Lay_INFO; // No error, no success
|
Gbl.AlertType = Lay_NONE; // Do not show alert
|
||||||
Gbl.Message[0] = '\0'; // Do not write anything
|
|
||||||
|
|
||||||
/***** Get parameter indicating if listing multiple users *****/
|
/***** Get parameter indicating if listing multiple users *****/
|
||||||
MultipleUsrs = Par_GetParToBool ("MultiUsrs");
|
MultipleUsrs = Par_GetParToBool ("MultiUsrs");
|
||||||
|
@ -1593,7 +1590,8 @@ void Rec_UpdateAndShowOtherCrsRecord (void)
|
||||||
/***** Update the record *****/
|
/***** Update the record *****/
|
||||||
Rec_UpdateCrsRecord (Gbl.Usrs.Other.UsrDat.UsrCod);
|
Rec_UpdateCrsRecord (Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||||
Gbl.AlertType = Lay_SUCCESS;
|
Gbl.AlertType = Lay_SUCCESS;
|
||||||
sprintf (Gbl.Message,"%s",Txt_Student_record_card_in_this_course_has_been_updated);
|
sprintf (Gbl.Message,"%s",
|
||||||
|
Txt_Student_record_card_in_this_course_has_been_updated);
|
||||||
|
|
||||||
/***** Show one or multiple records *****/
|
/***** Show one or multiple records *****/
|
||||||
if (MultipleUsrs)
|
if (MultipleUsrs)
|
||||||
|
@ -1631,8 +1629,6 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView,
|
||||||
// Rec_CRS_RECORD_PRINT
|
// Rec_CRS_RECORD_PRINT
|
||||||
};
|
};
|
||||||
char StrRecordWidth[10 + 1];
|
char StrRecordWidth[10 + 1];
|
||||||
unsigned Col1Width = 210;
|
|
||||||
unsigned Col2Width;
|
|
||||||
bool ItsMe;
|
bool ItsMe;
|
||||||
bool ICanEdit = false;
|
bool ICanEdit = false;
|
||||||
unsigned NumField;
|
unsigned NumField;
|
||||||
|
@ -1701,8 +1697,6 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Col2Width = Rec_RECORD_WIDTH - 10 * 2 - Col1Width;
|
|
||||||
|
|
||||||
/***** Start frame *****/
|
/***** Start frame *****/
|
||||||
sprintf (StrRecordWidth,"%upx",Rec_RECORD_WIDTH);
|
sprintf (StrRecordWidth,"%upx",Rec_RECORD_WIDTH);
|
||||||
Lay_StartRoundFrameTable (StrRecordWidth,NULL,
|
Lay_StartRoundFrameTable (StrRecordWidth,NULL,
|
||||||
|
@ -1746,12 +1740,11 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView,
|
||||||
|
|
||||||
/* Name of the field */
|
/* Name of the field */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"%s RIGHT_TOP COLOR%u\""
|
"<td class=\"REC_C1_BOT %s RIGHT_TOP COLOR%u\">"
|
||||||
" style=\"width:%upx;\">"
|
|
||||||
"%s:",
|
"%s:",
|
||||||
ICanEditThisField ? The_ClassForm[Gbl.Prefs.Theme] :
|
ICanEditThisField ? The_ClassForm[Gbl.Prefs.Theme] :
|
||||||
"REC_DAT_SMALL",
|
"REC_DAT_SMALL",
|
||||||
Gbl.RowEvenOdd,Col1Width,
|
Gbl.RowEvenOdd,
|
||||||
Gbl.CurrentCrs.Records.LstFields.Lst[NumField].Name);
|
Gbl.CurrentCrs.Records.LstFields.Lst[NumField].Name);
|
||||||
if (TypeOfView == Rec_CRS_LIST_ONE_RECORD ||
|
if (TypeOfView == Rec_CRS_LIST_ONE_RECORD ||
|
||||||
TypeOfView == Rec_CRS_LIST_SEVERAL_RECORDS)
|
TypeOfView == Rec_CRS_LIST_SEVERAL_RECORDS)
|
||||||
|
@ -1770,13 +1763,12 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView,
|
||||||
|
|
||||||
/***** Write form, text, or nothing depending on
|
/***** Write form, text, or nothing depending on
|
||||||
the user's role and the visibility of the field *****/
|
the user's role and the visibility of the field *****/
|
||||||
fprintf (Gbl.F.Out,"<td class=\"REC_DAT_BOLD LEFT_TOP COLOR%u\""
|
fprintf (Gbl.F.Out,"<td class=\"REC_C2_BOT REC_DAT_BOLD LEFT_TOP COLOR%u\">",
|
||||||
" style=\"width:%upx;\">",
|
Gbl.RowEvenOdd);
|
||||||
Gbl.RowEvenOdd,Col2Width);
|
|
||||||
if (ICanEditThisField) // Show with form
|
if (ICanEditThisField) // Show with form
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<textarea name=\"Field%ld\" rows=\"%u\""
|
fprintf (Gbl.F.Out,"<textarea name=\"Field%ld\" rows=\"%u\""
|
||||||
" style=\"width:450px;\">",
|
" class=\"REC_C2_BOT_INPUT\">",
|
||||||
Gbl.CurrentCrs.Records.LstFields.Lst[NumField].FieldCod,
|
Gbl.CurrentCrs.Records.LstFields.Lst[NumField].FieldCod,
|
||||||
Gbl.CurrentCrs.Records.LstFields.Lst[NumField].NumLines);
|
Gbl.CurrentCrs.Records.LstFields.Lst[NumField].NumLines);
|
||||||
if (ThisFieldHasText)
|
if (ThisFieldHasText)
|
||||||
|
|
Loading…
Reference in New Issue