Version 18.26

This commit is contained in:
Antonio Cañas Vargas 2019-01-02 15:10:51 +01:00
parent bec6bdfc1a
commit 7db7b51de2
24 changed files with 294 additions and 163 deletions

View File

@ -185,10 +185,9 @@ CREATE TABLE IF NOT EXISTS classrooms (
CtrCod INT NOT NULL,
ShortName VARCHAR(511) NOT NULL,
FullName VARCHAR(2047) NOT NULL,
NumStds INT NOT NULL,
MaxStudents INT NOT NULL,
UNIQUE INDEX(ClaCod),
INDEX(CtrCod),
INDEX(NumStds));
INDEX(CtrCod));
--
-- Table clicks_without_photo: stores the number of clicks that remains to each user before being required to submit his/her photo
--

View File

@ -272,6 +272,7 @@ Centre:
NEW. ActRemCla Remove a classroom
NEW. ActRenClaSho Change short name of a classroom
NEW. ActRenClaFul Change full name of a classroom
NEW. ActChgClaMaxStd Change number of students in a classroom
148. ActPrnCtrCrs Show print view of the academic calendar
149. ActChgCtrCrs1stDay Change first day of week and show academic calendar
@ -1807,6 +1808,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActRemCla */{1747,-1,TabUnk,ActSeeCla , 0, 0, 0,0x3C6, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Cla_RemoveClassroom ,NULL},
/* ActRenClaSho */{1748,-1,TabUnk,ActSeeCla , 0, 0, 0,0x3C6, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Cla_RenameClassroomShort ,NULL},
/* ActRenClaFul */{1749,-1,TabUnk,ActSeeCla , 0, 0, 0,0x3C6, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Cla_RenameClassroomFull ,NULL},
/* ActChgClaMaxStd */{1750,-1,TabUnk,ActSeeCla , 0, 0, 0,0x3C6, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Cla_ChangeMaxStudents ,NULL},
/* ActPrnCalCtr */{1632,-1,TabUnk,ActSeeCalCtr , 0, 0, 0,0x3C7, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,Cal_PrintCalendar ,NULL},
/* ActChgCalCtr1stDay*/{1633,-1,TabUnk,ActSeeCalCtr , 0, 0, 0,0x3C7, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Cal_ChangeFirstDayOfWeek ,Cal_DrawCalendarCtr ,NULL},
@ -4952,6 +4954,7 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
ActRemCla, // #1747
ActRenClaSho, // #1748
ActRenClaFul, // #1749
ActChgClaMaxStd, // #1750
};
/*****************************************************************************/

View File

@ -61,9 +61,9 @@ typedef enum
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
#define Act_NUM_ACTIONS (1 + 9 + 43 + 17 + 47 + 39 + 24 + 115 + 157 + 437 + 165 + 172 + 42 + 14 + 76)
#define Act_NUM_ACTIONS (1 + 9 + 43 + 17 + 47 + 40 + 24 + 115 + 157 + 437 + 165 + 172 + 42 + 14 + 76)
#define Act_MAX_ACTION_COD 1749
#define Act_MAX_ACTION_COD 1750
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13
@ -271,9 +271,10 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
#define ActRemCla (ActChgCalIns1stDay + 35)
#define ActRenClaSho (ActChgCalIns1stDay + 36)
#define ActRenClaFul (ActChgCalIns1stDay + 37)
#define ActChgClaMaxStd (ActChgCalIns1stDay + 38)
#define ActPrnCalCtr (ActChgCalIns1stDay + 38)
#define ActChgCalCtr1stDay (ActChgCalIns1stDay + 39)
#define ActPrnCalCtr (ActChgCalIns1stDay + 39)
#define ActChgCalCtr1stDay (ActChgCalIns1stDay + 40)
/*****************************************************************************/
/********************************* Degree tab ********************************/

View File

@ -668,7 +668,8 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (CurrentBanName,NewBanName)) // Different names
{
/***** If banner was in database... *****/

View File

@ -2035,7 +2035,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (CurrentCtrName,NewCtrName)) // Different names
{
/***** If degree was in database... *****/

View File

@ -364,10 +364,17 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 18.25.3 (2018-12-30)"
#define Log_PLATFORM_VERSION "SWAD 18.26 (2019-01-02)"
#define CSS_FILE "swad18.22.css"
#define JS_FILE "swad17.17.1.js"
/*
Version 18.26: Jan 02, 2019 New form and action to change maximum number of students in a classroom. (? lines)
4 changes necessary in database:
DROP INDEX NumStds ON classrooms;
ALTER TABLE classrooms CHANGE COLUMN NumStds MaxStudents INT NOT NULL;
UPDATE actions SET Txt='Cambiar máx. estudiantes en grupo' WHERE ActCod='106' AND Language='es';
UPDATE actions SET Txt='Cambiar máx. estudiantes en aula' WHERE ActCod='1750' AND Language='es';
Version 18.25.3: Dec 30, 2018 Fixed bugs in classrooms. (238514 lines)
Version 18.25.2: Dec 30, 2018 New database table for classrooms. (238525 lines)
8 changes necessary in database:
@ -378,7 +385,6 @@ INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1746','es','N','Crea
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1747','es','N','Eliminar aula');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1748','es','N','Cambiar nombre breve aula');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1749','es','N','Cambiar nombre completo aula');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1750','es','N','Cambiar nº estudiantes aula');
Copy the following icon to icon public directory:
sudo cp classroom.svg /var/www/html/swad/icon/

View File

@ -70,6 +70,8 @@ static void Cla_RenameClassroom (Cns_ShrtOrFullName_t ShrtOrFullName);
static bool Cla_CheckIfClassroomNameExists (const char *FieldName,const char *Name,long ClaCod);
static void Cla_UpdateClaNameDB (long ClaCod,const char *FieldName,const char *NewClaName);
static void Cla_WriteMaxStds (unsigned MaxStudents);
static void Cla_PutFormToCreateClassroom (void);
static void Cla_PutHeadClassrooms (void);
static void Cla_CreateClassroom (struct Classroom *Cla);
@ -102,7 +104,7 @@ void Cla_SeeClassrooms (void)
Tbl_StartTableWideMargin (2);
fprintf (Gbl.F.Out,"<tr>");
for (Order = Cla_ORDER_BY_CLASSROOM;
Order <= Cla_ORDER_BY_NUM_STDS;
Order <= Cla_ORDER_BY_MAX_STDS;
Order++)
{
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE\">");
@ -120,7 +122,7 @@ void Cla_SeeClassrooms (void)
}
fprintf (Gbl.F.Out,"</tr>");
/***** Write all classrooms and their nuber of students *****/
/***** Write all classrooms and their maximum of students *****/
for (NumCla = 0;
NumCla < Gbl.Classrooms.Num;
NumCla++)
@ -130,12 +132,11 @@ void Cla_SeeClassrooms (void)
"<td class=\"DAT LEFT_MIDDLE\">"
"%s"
"</td>"
"<td class=\"DAT RIGHT_MIDDLE\">"
"%u"
"</td>"
"</tr>",
Gbl.Classrooms.Lst[NumCla].FullName,
Gbl.Classrooms.Lst[NumCla].NumStds);
"<td class=\"DAT RIGHT_MIDDLE\">",
Gbl.Classrooms.Lst[NumCla].FullName);
Cla_WriteMaxStds (Gbl.Classrooms.Lst[NumCla].MaxStudents);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
/***** End table *****/
@ -164,10 +165,10 @@ void Cla_SeeClassrooms (void)
static void Cla_GetParamClaOrder (void)
{
Gbl.Classrooms.SelectedOrder = (Cla_Order_t)
Par_GetParToUnsignedLong ("Order",
0,
Cla_NUM_ORDERS - 1,
(unsigned long) Cla_ORDER_DEFAULT);
Par_GetParToUnsignedLong ("Order",
0,
Cla_NUM_ORDERS - 1,
(unsigned long) Cla_ORDER_DEFAULT);
}
/*****************************************************************************/
@ -273,15 +274,15 @@ void Cla_GetListClassrooms (void)
case Cla_ORDER_BY_CLASSROOM:
sprintf (OrderBySubQuery,"FullName");
break;
case Cla_ORDER_BY_NUM_STDS:
sprintf (OrderBySubQuery,"NumStds DESC,FullName");
case Cla_ORDER_BY_MAX_STDS:
sprintf (OrderBySubQuery,"MaxStudents DESC,FullName");
break;
}
NumRows = DB_QuerySELECT (&mysql_res,"can not get classrooms",
"SELECT ClaCod,"
"ShortName,"
"FullName,"
"NumStds"
"MaxStudents"
" FROM classrooms"
" WHERE CtrCod=%ld"
" ORDER BY %s",
@ -319,9 +320,9 @@ void Cla_GetListClassrooms (void)
Str_Copy (Cla->FullName,row[2],
Cla_MAX_BYTES_CLASSROOM_FULL_NAME);
/* Get number of students in this classroom (row[3]) */
if (sscanf (row[3],"%u",&Cla->NumStds) != 1)
Cla->NumStds = 0;
/* Get maximum number of students in this classroom (row[3]) */
if (sscanf (row[3],"%u",&Cla->MaxStudents) != 1)
Cla->MaxStudents = 0;
}
}
else
@ -346,7 +347,7 @@ void Cla_GetDataOfClassroomByCod (struct Classroom *Cla)
/***** Clear data *****/
Cla->ShrtName[0] = '\0';
Cla->FullName[0] = '\0';
Cla->NumStds = 0;
Cla->MaxStudents = 0;
/***** Check if classroom code is correct *****/
if (Cla->ClaCod < 0)
@ -369,7 +370,7 @@ void Cla_GetDataOfClassroomByCod (struct Classroom *Cla)
NumRows = DB_QuerySELECT (&mysql_res,"can not get data of a classroom",
"SELECT ShortName,"
"FullName,"
"NumStds"
"MaxStudents"
" FROM classrooms"
" WHERE ClaCod=%ld",
Cla->ClaCod);
@ -388,9 +389,9 @@ void Cla_GetDataOfClassroomByCod (struct Classroom *Cla)
Str_Copy (Cla->FullName,row[1],
Cla_MAX_BYTES_CLASSROOM_FULL_NAME);
/* Get number of students in this classroom (row[2]) */
if (sscanf (row[2],"%u",&Cla->NumStds) != 1)
Cla->NumStds = 0;
/* Get maximum number of students in this classroom (row[2]) */
if (sscanf (row[2],"%u",&Cla->MaxStudents) != 1)
Cla->MaxStudents = 0;
}
/***** Free structure that stores the query result *****/
@ -436,15 +437,10 @@ static void Cla_ListClassroomsForEdition (void)
/* Put icon to remove classroom */
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"BM\">");
if (Cla->NumStds) // Classroom has students ==> deletion forbidden
Ico_PutIconRemovalNotAllowed ();
else
{
Frm_StartForm (ActRemCla);
Cla_PutParamClaCod (Cla->ClaCod);
Ico_PutIconRemove ();
Frm_EndForm ();
}
Frm_StartForm (ActRemCla);
Cla_PutParamClaCod (Cla->ClaCod);
Ico_PutIconRemove ();
Frm_EndForm ();
fprintf (Gbl.F.Out,"</td>");
/* Classroom code */
@ -477,12 +473,18 @@ static void Cla_ListClassroomsForEdition (void)
Frm_EndForm ();
fprintf (Gbl.F.Out,"</td>");
/* Number of students */
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u"
"</td>"
"</tr>",
Cla->NumStds);
/* Maximum number of students */
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">");
Frm_StartForm (ActChgClaMaxStd);
Cla_PutParamClaCod (Cla->ClaCod);
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"MaxStudents\""
" size=\"3\" maxlength=\"10\" value=\"");
Cla_WriteMaxStds (Cla->MaxStudents);
fprintf (Gbl.F.Out,"\" onchange=\"document.getElementById('%s').submit();\" />",
Gbl.Form.Id);
Frm_EndForm ();
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
/***** End table *****/
@ -612,7 +614,8 @@ static void Cla_RenameClassroom (Cns_ShrtOrFullName_t ShrtOrFullName)
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (CurrentClaName,NewClaName)) // Different names
{
/***** If classroom was in database... *****/
@ -678,6 +681,81 @@ static void Cla_UpdateClaNameDB (long ClaCod,const char *FieldName,const char *N
FieldName,NewClaName,ClaCod);
}
/*****************************************************************************/
/************** Change maximum number of students in a classroom *************/
/*****************************************************************************/
void Cla_ChangeMaxStudents (void)
{
extern const char *Txt_The_maximum_number_of_students_has_not_changed;
extern const char *Txt_The_classroom_X_does_not_have_a_student_limit_now;
extern const char *Txt_The_maximum_number_of_students_is_now_X;
struct Classroom *Cla;
unsigned NewMaxStds;
/***** Use current editing classroom *****/
Cla = &Gbl.Classrooms.EditingCla;
/***** Get parameters from form *****/
/* Get the code of the classroom */
if ((Cla->ClaCod = Cla_GetParamClaCod ()) == -1L)
Lay_ShowErrorAndExit ("Code of classroom is missing.");
/* Get the new maximum number of students of the group */
NewMaxStds = (unsigned)
Par_GetParToUnsignedLong ("MaxStudents",
0,
Cla_MAX_STUDENTS_IN_A_CLASSROOM,
Cla_NUM_STUDENTS_NOT_LIMITED);
/***** Get data of the classroom from database *****/
Cla_GetDataOfClassroomByCod (Cla);
/***** Check if the old maximum of students equals the new one
(this happens when return is pressed without changes) *****/
if (Cla->MaxStudents == NewMaxStds)
{
/***** Message to show no changes made *****/
Gbl.Alert.Type = Ale_INFO;
Str_Copy (Gbl.Alert.Txt,Txt_The_maximum_number_of_students_has_not_changed,
Ale_MAX_BYTES_ALERT);
}
else
{
/***** Update the table of groups changing the old maximum of students to the new *****/
DB_QueryUPDATE ("can not update the maximum number of students"
" in a classroom",
"UPDATE classrooms SET MaxStudents=%u WHERE ClaCod=%ld",
NewMaxStds,Cla->ClaCod);
Cla->MaxStudents = NewMaxStds;
/***** Message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
if (NewMaxStds > Grp_MAX_STUDENTS_IN_A_GROUP)
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_classroom_X_does_not_have_a_student_limit_now,
Cla->FullName);
else
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_maximum_number_of_students_is_now_X,
NewMaxStds);
}
Ale_ShowAlert (Gbl.Alert.Type,Gbl.Alert.Txt);
/***** Show the form again *****/
Cla_EditClassrooms ();
}
/*****************************************************************************/
/*********** Write the maximum number of students in a classroom *************/
/*****************************************************************************/
static void Cla_WriteMaxStds (unsigned MaxStudents)
{
if (MaxStudents <= Cla_MAX_STUDENTS_IN_A_CLASSROOM)
fprintf (Gbl.F.Out,"%u",MaxStudents);
}
/*****************************************************************************/
/******************* Put a form to create a new classroom ********************/
/*****************************************************************************/
@ -727,9 +805,12 @@ static void Cla_PutFormToCreateClassroom (void)
Cla_MAX_CHARS_CLASSROOM_FULL_NAME,Cla->FullName);
/***** Number of students *****/
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"0"
"</td>"
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">"
"<input type=\"text\" name=\"MaxStudents\""
" size=\"3\" maxlength=\"10\" value=\"");
Cla_WriteMaxStds (Cla->MaxStudents);
fprintf (Gbl.F.Out,"\" />"
"</td>"
"</tr>");
/***** End table, send button and end box *****/
@ -748,7 +829,7 @@ static void Cla_PutHeadClassrooms (void)
extern const char *Txt_Code;
extern const char *Txt_Short_name;
extern const char *Txt_Full_name;
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
extern const char *Txt_Max_BR_students;
fprintf (Gbl.F.Out,"<tr>"
"<th class=\"BM\"></th>"
@ -768,7 +849,7 @@ static void Cla_PutHeadClassrooms (void)
Txt_Code,
Txt_Short_name,
Txt_Full_name,
Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN]);
Txt_Max_BR_students);
}
/*****************************************************************************/
@ -790,6 +871,13 @@ void Cla_RecFormNewClassroom (void)
/* Get classroom full name */
Par_GetParToText ("FullName",Cla->FullName,Cla_MAX_BYTES_CLASSROOM_FULL_NAME);
/* Get maximum number of students */
Cla->MaxStudents = (unsigned)
Par_GetParToUnsignedLong ("MaxStudents",
0,
Cla_MAX_STUDENTS_IN_A_CLASSROOM,
Cla_NUM_STUDENTS_NOT_LIMITED);
if (Cla->ShrtName[0] && Cla->FullName[0]) // If there's a classroom name
{
/***** If name of classroom was in database... *****/
@ -828,11 +916,11 @@ static void Cla_CreateClassroom (struct Classroom *Cla)
/***** Create a new classroom *****/
DB_QueryINSERT ("can not create classroom",
"INSERT INTO classrooms"
" (CtrCod,ShortName,FullName,NumStds)"
" (CtrCod,ShortName,FullName,MaxStudents)"
" VALUES"
" (%ld,'%s','%s',%u)",
Gbl.CurrentCtr.Ctr.CtrCod,
Cla->ShrtName,Cla->FullName,Cla->NumStds);
Cla->ShrtName,Cla->FullName,Cla->MaxStudents);
/***** Write success message *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),

View File

@ -39,20 +39,24 @@
#define Cla_MAX_CHARS_CLASSROOM_FULL_NAME (128 - 1) // 127
#define Cla_MAX_BYTES_CLASSROOM_FULL_NAME ((Cla_MAX_CHARS_CLASSROOM_FULL_NAME + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
#define Cla_MAX_STUDENTS_IN_A_CLASSROOM 10000 // If max of students in a classroom is greater than this, it is considered infinite
#define Cla_NUM_STUDENTS_NOT_LIMITED INT_MAX // This number can be stored in database as an integer...
// ...and means that a classroom has no limit of students
struct Classroom
{
long ClaCod;
long InsCod;
char ShrtName[Cla_MAX_BYTES_CLASSROOM_SHRT_NAME + 1];
char FullName[Cla_MAX_BYTES_CLASSROOM_FULL_NAME + 1];
unsigned NumStds;
unsigned MaxStudents;
};
#define Cla_NUM_ORDERS 2
typedef enum
{
Cla_ORDER_BY_CLASSROOM = 0,
Cla_ORDER_BY_NUM_STDS = 1,
Cla_ORDER_BY_MAX_STDS = 1,
} Cla_Order_t;
#define Cla_ORDER_DEFAULT Cla_ORDER_BY_CLASSROOM
@ -70,6 +74,7 @@ long Cla_GetParamClaCod (void);
void Cla_RemoveClassroom (void);
void Cla_RenameClassroomShort (void);
void Cla_RenameClassroomFull (void);
void Cla_ChangeMaxStudents (void);
void Cla_RecFormNewClassroom (void);
#endif

View File

@ -1806,7 +1806,8 @@ void Cty_RenameCountry (void)
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (Cty->Name[Language],NewCtyName)) // Different names
{
/***** If country was in database... *****/

View File

@ -2730,7 +2730,8 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (CurrentCrsName,NewCrsName)) // Different names
{
/***** If course was in database... *****/

View File

@ -467,15 +467,15 @@ mysql> DESCRIBE chat;
/***** Table classrooms *****/
/*
mysql> DESCRIBE classrooms;
+-----------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------------+------+-----+---------+----------------+
| ClaCod | int(11) | NO | PRI | NULL | auto_increment |
| CtrCod | int(11) | NO | MUL | NULL | |
| ShortName | varchar(511) | NO | | NULL | |
| FullName | varchar(2047) | NO | | NULL | |
| NumStds | int(11) | NO | MUL | NULL | |
+-----------+---------------+------+-----+---------+----------------+
+-------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+---------------+------+-----+---------+----------------+
| ClaCod | int(11) | NO | PRI | NULL | auto_increment |
| CtrCod | int(11) | NO | MUL | NULL | |
| ShortName | varchar(511) | NO | | NULL | |
| FullName | varchar(2047) | NO | | NULL | |
| MaxStudents | int(11) | NO | | NULL | |
+-------------+---------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS classrooms ("
@ -483,10 +483,9 @@ mysql> DESCRIBE classrooms;
"CtrCod INT NOT NULL,"
"ShortName VARCHAR(511) NOT NULL," // Cla_MAX_BYTES_CLASSROOM_SHRT_NAME
"FullName VARCHAR(2047) NOT NULL," // Cla_MAX_BYTES_CLASSROOM_FULL_NAME
"NumStds INT NOT NULL,"
"MaxStudents INT NOT NULL,"
"UNIQUE INDEX(ClaCod),"
"INDEX(CtrCod),"
"INDEX(NumStds))");
"INDEX(CtrCod))");
/***** Table clicks_without_photo *****/
/*

View File

@ -1998,7 +1998,8 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (CurrentDegName,NewDegName)) // Different names
{
/***** If degree was in database... *****/

View File

@ -963,7 +963,8 @@ void DT_RenameDegreeType (void)
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (DegTyp->DegTypName,NewNameDegTyp)) // Different names
{
/***** If degree type was in database... *****/

View File

@ -739,7 +739,8 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (CurrentDptName,NewDptName)) // Different names
{
/***** If degree was in database... *****/

View File

@ -35,6 +35,7 @@
#include "swad_action.h"
#include "swad_calendar.h"
#include "swad_classroom.h"
#include "swad_config.h"
#include "swad_constant.h"
#include "swad_exam.h"
@ -234,6 +235,8 @@ void Gbl_InitializeGlobals (void)
Gbl.CurrentDeg.Deg.DegCod = -1L;
Gbl.CurrentDeg.Deg.ShrtName[0] = Gbl.CurrentDeg.Deg.FullName[0] = '\0';
Gbl.Classrooms.EditingCla.MaxStudents = Cla_NUM_STUDENTS_NOT_LIMITED;
Gbl.CurrentCrs.Crs.CrsCod = -1L;
Gbl.CurrentCrs.Crs.ShrtName[0] = Gbl.CurrentCrs.Crs.FullName[0] = '\0';
Gbl.CurrentCrs.Info.ShowMsgMustBeRead = 0;

View File

@ -148,7 +148,7 @@ static void Grp_PutParamRemGrp (void);
static void Grp_RemoveGroupTypeCompletely (void);
static void Grp_RemoveGroupCompletely (void);
static void Grp_WriteMaxStdsGrp (unsigned MaxStudents);
static void Grp_WriteMaxStds (unsigned MaxStudents);
static long Grp_GetParamGrpTypCod (void);
static long Grp_GetParamGrpCod (void);
static void Grp_PutParamGrpTypCod (long GrpTypCod);
@ -1615,7 +1615,7 @@ static void Grp_ListGroupsForEdition (void)
Grp_PutParamGrpCod (Grp->GrpCod);
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"MaxStudents\""
" size=\"3\" maxlength=\"10\" value=\"");
Grp_WriteMaxStdsGrp (Grp->MaxStudents);
Grp_WriteMaxStds (Grp->MaxStudents);
fprintf (Gbl.F.Out,"\" onchange=\"document.getElementById('%s').submit();\" />",
Gbl.Form.Id);
Frm_EndForm ();
@ -2439,7 +2439,7 @@ static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight)
if (Highlight)
fprintf (Gbl.F.Out," LIGHT_BLUE");
fprintf (Gbl.F.Out,"\">");
Grp_WriteMaxStdsGrp (Grp->MaxStudents);
Grp_WriteMaxStds (Grp->MaxStudents);
fprintf (Gbl.F.Out,"&nbsp;"
"</td>");
@ -2655,7 +2655,7 @@ static void Grp_PutFormToCreateGroup (void)
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">"
"<input type=\"text\" name=\"MaxStudents\""
" size=\"3\" maxlength=\"10\" value=\"");
Grp_WriteMaxStdsGrp (Gbl.CurrentCrs.Grps.MaxStudents);
Grp_WriteMaxStds (Gbl.CurrentCrs.Grps.MaxStudents);
fprintf (Gbl.F.Out,"\" />"
"</td>"
"</tr>");
@ -4345,7 +4345,7 @@ void Grp_ChangeMandatGrpTyp (void)
Grp_GetDataOfGroupTypeByCod (&Gbl.CurrentCrs.Grps.GrpTyp);
/***** Check if the old type of enrolment match the new
(this happens when return is pressed without changes in the form) *****/
(this happens when return is pressed without changes) *****/
if (Gbl.CurrentCrs.Grps.GrpTyp.MandatoryEnrolment == NewMandatoryEnrolment)
{
AlertType = Ale_INFO;
@ -4476,9 +4476,9 @@ void Grp_ChangeOpenTimeGrpTyp (void)
void Grp_ChangeMaxStdsGrp (void)
{
extern const char *Txt_The_maximum_number_of_students_in_the_group_X_has_not_changed;
extern const char *Txt_The_group_X_now_has_no_limit_of_students;
extern const char *Txt_The_maximum_number_of_students_in_the_group_X_is_now_Y;
extern const char *Txt_The_maximum_number_of_students_has_not_changed;
extern const char *Txt_The_group_X_does_not_have_a_student_limit_now;
extern const char *Txt_The_maximum_number_of_students_is_now_X;
struct GroupData GrpDat;
unsigned NewMaxStds;
Ale_AlertType_t AlertType;
@ -4495,17 +4495,17 @@ void Grp_ChangeMaxStdsGrp (void)
Grp_MAX_STUDENTS_IN_A_GROUP,
Grp_NUM_STUDENTS_NOT_LIMITED);
/* Get from the database the type, name, and antiguo maximum of students of the group */
/* Get from the database the type, name, and old maximum of students of the group */
GrpDat.GrpCod = Gbl.CurrentCrs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat);
/***** Check if the old maximum of students equals the new one (this happens when user press return without change the form) *****/
/***** Check if the old maximum of students equals the new one
(this happens when return is pressed without changes) *****/
if (GrpDat.MaxStudents == NewMaxStds)
{
AlertType = Ale_INFO;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_maximum_number_of_students_in_the_group_X_has_not_changed,
GrpDat.GrpName);
Str_Copy (Gbl.Alert.Txt,Txt_The_maximum_number_of_students_has_not_changed,
Ale_MAX_BYTES_ALERT);
}
else
{
@ -4519,12 +4519,12 @@ void Grp_ChangeMaxStdsGrp (void)
AlertType = Ale_SUCCESS;
if (NewMaxStds > Grp_MAX_STUDENTS_IN_A_GROUP)
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_group_X_now_has_no_limit_of_students,
Txt_The_group_X_does_not_have_a_student_limit_now,
GrpDat.GrpName);
else
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_maximum_number_of_students_in_the_group_X_is_now_Y,
GrpDat.GrpName,NewMaxStds);
Txt_The_maximum_number_of_students_is_now_X,
NewMaxStds);
}
/***** Show the form again *****/
@ -4534,10 +4534,10 @@ void Grp_ChangeMaxStdsGrp (void)
}
/*****************************************************************************/
/************ Write the number maximum of students in a group ***************/
/************* Write the maximum number of students in a group ***************/
/*****************************************************************************/
static void Grp_WriteMaxStdsGrp (unsigned MaxStudents)
static void Grp_WriteMaxStds (unsigned MaxStudents)
{
if (MaxStudents <= Grp_MAX_STUDENTS_IN_A_GROUP)
fprintf (Gbl.F.Out,"%u",MaxStudents);
@ -4592,7 +4592,8 @@ void Grp_RenameGroupType (void)
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,NewNameGrpTyp)) // Different names
{
/***** If group type was in database... *****/
@ -4671,7 +4672,8 @@ void Grp_RenameGroup (void)
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (GrpDat.GrpName,NewNameGrp)) // Different names
{
/***** If group was in database... *****/

View File

@ -920,7 +920,8 @@ void Hld_RenameHoliday1 (void)
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (Hld->Name,NewHldName)) // Different names
{
/***** If degree was in database... *****/

View File

@ -1855,7 +1855,8 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (CurrentInsName,NewInsName)) // Different names
{
/***** If institution was in database... *****/

View File

@ -590,7 +590,8 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (CurrentLnkName,NewLnkName)) // Different names
{
/***** If link was in database... *****/

View File

@ -649,7 +649,8 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (CurrentMaiName,NewMaiName)) // Different names
{
/***** If mail was in database... *****/

View File

@ -699,7 +699,8 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (CurrentPlcName,NewPlcName)) // Different names
{
/***** If place was in database... *****/

View File

@ -547,7 +547,8 @@ void Plg_RenamePlugin (void)
}
else
{
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
/***** Check if old and new names are the same
(this happens when return is pressed without changes) *****/
if (strcmp (Plg->Name,NewPlgName)) // Different names
{
/***** If plugin was in database... *****/

View File

@ -803,7 +803,7 @@ void Rec_RenameField (void)
/* Get the new group name */
Par_GetParToText ("FieldName",NewFieldName,Rec_MAX_BYTES_NAME_FIELD);
/***** Get from the database the antiguo group name *****/
/***** Get from the database the old field name *****/
Rec_GetFieldByCod (Gbl.CurrentCrs.Records.Field.FieldCod,
Gbl.CurrentCrs.Records.Field.Name,
&Gbl.CurrentCrs.Records.Field.NumLines,
@ -886,7 +886,7 @@ void Rec_ChangeLinesField (void)
/* Get from the database the number of lines of the field */
Rec_GetFieldByCod (Gbl.CurrentCrs.Records.Field.FieldCod,Gbl.CurrentCrs.Records.Field.Name,&Gbl.CurrentCrs.Records.Field.NumLines,&Gbl.CurrentCrs.Records.Field.Visibility);
/***** Check if the old number of rows antiguo match the new one
/***** Check if the old number of rows matches the new one
(this happens when return is pressed without changes) *****/
if (Gbl.CurrentCrs.Records.Field.NumLines == NewNumLines)
{
@ -941,7 +941,7 @@ void Rec_ChangeVisibilityField (void)
Rec_GetFieldByCod (Gbl.CurrentCrs.Records.Field.FieldCod,Gbl.CurrentCrs.Records.Field.Name,&Gbl.CurrentCrs.Records.Field.NumLines,&Gbl.CurrentCrs.Records.Field.Visibility);
/***** Check if the old visibility matches the new one
(this happens whe return is pressed without changes in the form) *****/
(this happens when return is pressed without changes) *****/
if (Gbl.CurrentCrs.Records.Field.Visibility == NewVisibility)
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),

View File

@ -3917,23 +3917,23 @@ const char *Txt_CLASSROOMS_HELP_ORDER[Cla_NUM_ORDERS] =
#endif
,
#if L==1 // ca
"Ordenar per nombre d'estudiants"
"Ordenar per nombre m&agrave;xim d'estudiants"
#elif L==2 // de
"Nach Anzahl der Studenten sortieren"
"Sortieren nach maximaler Sch&uuml;lerzahl"
#elif L==3 // en
"Sort by no. of students"
"Sort by maximum number of students"
#elif L==4 // es
"Ordenar por n&ordm; de estudiantes"
"Ordenar por n&ordm; m&aacute;ximo de estudiantes"
#elif L==5 // fr
"Trier par nombre d'&eacute;tudiants"
"Trier par nombre maximum d'&eacute;tudiants"
#elif L==6 // gn
"Ordenar por n&ordm; de estudiantes" // Okoteve traducción
"Ordenar por n&ordm; m&aacute;ximo de estudiantes" // Okoteve traducción
#elif L==7 // it
"Ordina per numero di studenti"
"Ordina per numero massimo di studenti"
#elif L==8 // pl
"Sortuj wedlug studenci"
"Sortuj wed&lsgtrok;ug maksymalnej liczby student&oacute;w"
#elif L==9 // pt
"Classificar por n&uacute;mero de estudantes"
"Ordenar pelo n&uacute;mero m&aacute;ximo de estudantes"
#endif
};
@ -3960,23 +3960,23 @@ const char *Txt_CLASSROOMS_ORDER[Cla_NUM_ORDERS] =
#endif
,
#if L==1 // ca
"Estudiants"
"M&agrave;xim<br />d'est."
#elif L==2 // de
"Studenten"
"Max.<br />Stud."
#elif L==3 // en
"Students"
"Max.<br />stud."
#elif L==4 // es
"Estudiantes"
"M&aacute;x.<br />estu."
#elif L==5 // fr
"&Eacute;tudiants"
"Max.<br />&eacute;tud."
#elif L==6 // gn
"Estudiantes" // Okoteve traducción
"M&aacute;x.<br />estu." // Okoteve traducción
#elif L==7 // it
"Studenti"
"Max.<br />stud."
#elif L==8 // pl
"Student&oacute;w"
"Max.<br />stud."
#elif L==9 // pt
"Estudantes"
"M&aacute;x.<br />estu."
#endif
};
@ -43654,6 +43654,27 @@ const char *Txt_The_classroom_X_already_exists = // Warning: it is very importan
"A sala de clase <strong>%s</strong> j&aacute; existe.";
#endif
const char *Txt_The_classroom_X_does_not_have_a_student_limit_now = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"L'aula <strong>%s</strong> ara no t&eacute; cap l&iacute;mit d'estudiants.";
#elif L==2 // de
"Das Klassenzimmer <strong>%s</strong> hat jetzt kein Studentenlimit.";
#elif L==3 // en
"The classroom <strong>%s</strong> does not have a student limit now.";
#elif L==4 // es
"El aula <strong>%s</strong> no tiene ahora l&iacute;mite de estudiantes.";
#elif L==5 // fr
"La salle de classe <strong>%s</strong> n'a plus de limite d'&eacute;tudiants.";
#elif L==6 // gn
"El aula <strong>%s</strong> no tiene ahora l&iacute;mite de estudiantes."; // Okoteve traducción
#elif L==7 // it
"L'aula <strong>%s</strong> ora non ha limite di studenti.";
#elif L==8 // pl
"Klasa <strong>%s</strong> nie ma teraz &zdot;adnych limit&oacute;w uczni&oacute;w.";
#elif L==9 // pt
"A sala de clase <strong>%s</strong> n&atilde;o tem limite de estudantes agora.";
#endif
const char *Txt_The_classroom_X_has_been_renamed_as_Y = // Warning: it is very important to include two %s in the following sentences
#if L==1 // ca
"L'aula <strong>%s</strong> ha passat a denominar-se <strong>%s</strong>.";
@ -44932,25 +44953,25 @@ const char *Txt_The_group_X_is_now_open = // Warning: it is very important to in
"O grupo <strong>%s</strong> est&aacute; agora aberto.";
#endif
const char *Txt_The_group_X_now_has_no_limit_of_students = // Warning: it is very important to include %s in the following sentences
const char *Txt_The_group_X_does_not_have_a_student_limit_now = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"El grupo <strong>%s</strong> no tiene ahora l&iacute;mite de estudiantes."; // Necessita traduccio
"El grup <strong>%s</strong> ara no t&eacute; cap l&iacute;mit d'estudiants.";
#elif L==2 // de
"The group <strong>%s</strong> now has no limit of students.";
"Die Gruppe <strong>%s</strong> hat jetzt kein Studentenlimit.";
#elif L==3 // en
"The group <strong>%s</strong> now has no limit of students.";
"The group <strong>%s</strong> does not have a student limit now.";
#elif L==4 // es
"El grupo <strong>%s</strong> no tiene ahora l&iacute;mite de estudiantes.";
#elif L==5 // fr
"The group <strong>%s</strong> now has no limit of students.";
"Le groupe <strong>%s</strong> n'a plus de limite d'&eacute;tudiants.";
#elif L==6 // gn
"El grupo <strong>%s</strong> no tiene ahora l&iacute;mite de estudiantes."; // Okoteve traducción
#elif L==7 // it
"Il gruppo <strong>%s</strong> ora non ha limite di studenti.";
#elif L==8 // pl
"The group <strong>%s</strong> now has no limit of students."; // Potrzebujesz tlumaczenie
"Grupa <strong>%s</strong> nie ma teraz &zdot;adnych limit&oacute;w uczni&oacute;w.";
#elif L==9 // pt
"The group <strong>%s</strong> now has no limit of students.";
"O grupo <strong>%s</strong> n&atilde;o tem limite de estudantes agora.";
#endif
const char *Txt_The_groups_will_automatically_open =
@ -45553,64 +45574,55 @@ const char *Txt_the_marks_of_a_student_chosen_at_random_ =
" se voc&ecirc; vir mais de um estudante, isso significa que o n&uacute;mero de cabe&ccedil;a ou p&eacute; linhas n&atilde;o est&aacute; correto";
#endif
const char *Txt_The_maximum_number_of_students_in_the_group_X_has_not_changed = // Warning: it is very important to include %s in the following sentences
const char *Txt_The_maximum_number_of_students_has_not_changed =
#if L==1 // ca
"El n&ordm; m&aacute;ximo de estudiantes"
" del grupo <strong>%s</strong> no ha cambiado."; // Necessita traduccio
"El nombre m&agrave;xim d'estudiants no ha canviat.";
#elif L==2 // de
"The maximum number of students"
" in the group <strong>%s</strong> has not changed."; // Need Übersetzung
"Die maximale Anzahl von Studenten hat sich nicht ge&auml;ndert.";
#elif L==3 // en
"The maximum number of students"
" in the group <strong>%s</strong> has not changed.";
"The maximum number of students has not changed.";
#elif L==4 // es
"El n&ordm; m&aacute;ximo de estudiantes"
" del grupo <strong>%s</strong> no ha cambiado.";
"El n&ordm; m&aacute;ximo de estudiantes no ha cambiado.";
#elif L==5 // fr
"The maximum number of students"
" in the group <strong>%s</strong> has not changed."; // Besoin de traduction
"Le nombre maximum d'&eacute;tudiants n'a pas chang&eacute;.";
#elif L==6 // gn
"El n&ordm; m&aacute;ximo de estudiantes"
" del grupo <strong>%s</strong> no ha cambiado."; // Okoteve traducción
"El n&ordm; m&aacute;ximo de estudiantes no ha cambiado."; // Okoteve traducción
#elif L==7 // it
"Il numero massimo di studenti"
" nel gruppo <strong>%s</strong> non &egrave; cambiato.";
"Il numero massimo di studenti non &egrave; cambiato.";
#elif L==8 // pl
"The maximum number of students"
" in the group <strong>%s</strong> has not changed."; // Potrzebujesz tlumaczenie
"Maksymalna liczba student&oacute;w nie uleg&lstrok;a zmianie.";
#elif L==9 // pt
"O n&uacute;mero m&aacute;ximo de estudantes"
" no grupo <strong>%s</strong> n&atilde;o foi alterado.";
"O n&uacute;mero m&aacute;ximo de estudantes n&atilde;o foi alterado.";
#endif
const char *Txt_The_maximum_number_of_students_in_the_group_X_is_now_Y = // Warning: it is very important to include %s and %u in the following sentences
const char *Txt_The_maximum_number_of_students_is_now_X = // Warning: it is very important to include %u in the following sentences
#if L==1 // ca
"El n&ordm; m&aacute;ximo de estudiantes"
" del grupo <strong>%s</strong> ahora es <strong>%u</strong>."; // Necessita traduccio
"El nombre m&agrave;xim d'estudiants"
" ara &eacute;s <strong>%u</strong>.";
#elif L==2 // de
"The maximum number of students"
" in the group <strong>%s</strong> is now <strong>%u</strong>."; // Need Übersetzung
"Die maximale Anzahl von Studenten"
" betr&auml;gt jetzt <strong>%u</strong>.";
#elif L==3 // en
"The maximum number of students"
" in the group <strong>%s</strong> is now <strong>%u</strong>.";
" is now <strong>%u</strong>.";
#elif L==4 // es
"El n&ordm; m&aacute;ximo de estudiantes"
" del grupo <strong>%s</strong> ahora es <strong>%u</strong>.";
" ahora es <strong>%u</strong>.";
#elif L==5 // fr
"The maximum number of students"
" in the group <strong>%s</strong> is now <strong>%u</strong>."; // Besoin de traduction
"Le nombre maximum d'&eacute;tudiants"
" est maintenant de <strong>%u</strong>.";
#elif L==6 // gn
"El n&ordm; m&aacute;ximo de estudiantes"
" del grupo <strong>%s</strong> ahora es <strong>%u</strong>."; // Okoteve traducción
" ahora es <strong>%u</strong>."; // Okoteve traducción
#elif L==7 // it
"Il numero massimo di studenti"
" nel gruppo <strong>%s</strong> &egrave; ora <strong>%u</strong>.";
" &egrave; ora <strong>%u</strong>.";
#elif L==8 // pl
"The maximum number of students"
" in the group <strong>%s</strong> is now <strong>%u</strong>."; // Potrzebujesz tlumaczenie
"Maksymalna liczba student&oacute;w"
" wynosi teraz <strong>%u</strong>.";
#elif L==9 // pt
"O n&uacute;mero m&aacute;ximo de estudantes"
" no grupo <strong>%s</strong> &eacute; agora <strong>%u</strong>.";
" &eacute; agora <strong>%u</strong>.";
#endif
const char *Txt_The_message_has_not_been_sent_to_any_recipient =