Version 18.27.5

This commit is contained in:
Antonio Cañas Vargas 2019-01-04 12:53:40 +01:00
parent 4870c7e134
commit 3cb1af22de
6 changed files with 191 additions and 101 deletions

View File

@ -364,10 +364,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 18.27.4 (2019-01-04)"
#define Log_PLATFORM_VERSION "SWAD 18.27.5 (2019-01-04)"
#define CSS_FILE "swad18.22.css"
#define JS_FILE "swad17.17.1.js"
/*
Version 18.27.5: Jan 04, 2019 Selection of classroom in form to create group. (238964 lines)
Version 18.27.4: Jan 04, 2019 New field in groups table to select a classroom. (238881 lines)
1 change necessary in database:
ALTER TABLE crs_grp ADD COLUMN ClaCod INT NOT NULL DEFAULT -1 AFTER GrpName,ADD INDEX (ClaCod);

View File

@ -97,7 +97,7 @@ void Cla_SeeClassrooms (void)
Cla_GetParamClaOrder ();
/***** Get list of classrooms *****/
Cla_GetListClassrooms ();
Cla_GetListClassrooms (Cla_ALL_DATA);
/***** Table head *****/
Box_StartBox (NULL,Txt_Classrooms,Cla_PutIconsListingClassrooms,
@ -229,7 +229,7 @@ void Cla_EditClassrooms (void)
extern const char *Txt_Classrooms;
/***** Get list of classrooms *****/
Cla_GetListClassrooms ();
Cla_GetListClassrooms (Cla_ALL_DATA);
/***** Start box *****/
Box_StartBox (NULL,Txt_Classrooms,Cla_PutIconsEditingClassrooms,
@ -278,7 +278,7 @@ void Cla_PutIconToViewClassrooms (void)
/************************** List all the classrooms **************************/
/*****************************************************************************/
void Cla_GetListClassrooms (void)
void Cla_GetListClassrooms (Cla_WhichData_t WhichData)
{
static const char *OrderBySubQuery[Cla_NUM_ORDERS] =
{
@ -294,17 +294,32 @@ void Cla_GetListClassrooms (void)
struct Classroom *Cla;
/***** Get classrooms from database *****/
NumRows = DB_QuerySELECT (&mysql_res,"can not get classrooms",
"SELECT ClaCod,"
"ShortName,"
"FullName,"
"Capacity,"
"Location"
" FROM classrooms"
" WHERE CtrCod=%ld"
" ORDER BY %s",
Gbl.CurrentCtr.Ctr.CtrCod,
OrderBySubQuery[Gbl.Classrooms.SelectedOrder]);
switch (WhichData)
{
case Cla_ALL_DATA:
NumRows = DB_QuerySELECT (&mysql_res,"can not get classrooms",
"SELECT ClaCod,"
"ShortName,"
"FullName,"
"Capacity,"
"Location"
" FROM classrooms"
" WHERE CtrCod=%ld"
" ORDER BY %s",
Gbl.CurrentCtr.Ctr.CtrCod,
OrderBySubQuery[Gbl.Classrooms.SelectedOrder]);
break;
case Cla_ONLY_SHRT_NAME:
default:
NumRows = DB_QuerySELECT (&mysql_res,"can not get classrooms",
"SELECT ClaCod,"
"ShortName"
" FROM classrooms"
" WHERE CtrCod=%ld"
" ORDER BY ShortName",
Gbl.CurrentCtr.Ctr.CtrCod);
break;
}
/***** Count number of rows in result *****/
if (NumRows) // Classrooms found...
@ -333,17 +348,20 @@ void Cla_GetListClassrooms (void)
Str_Copy (Cla->ShrtName,row[1],
Cla_MAX_BYTES_SHRT_NAME);
/* Get the full name of the classroom (row[2]) */
Str_Copy (Cla->FullName,row[2],
Cla_MAX_BYTES_FULL_NAME);
if (WhichData == Cla_ALL_DATA)
{
/* Get the full name of the classroom (row[2]) */
Str_Copy (Cla->FullName,row[2],
Cla_MAX_BYTES_FULL_NAME);
/* Get seating capacity in this classroom (row[3]) */
if (sscanf (row[3],"%u",&Cla->Capacity) != 1)
Cla->Capacity = Cla_UNLIMITED_CAPACITY;
/* Get seating capacity in this classroom (row[3]) */
if (sscanf (row[3],"%u",&Cla->Capacity) != 1)
Cla->Capacity = Cla_UNLIMITED_CAPACITY;
/* Get the full name of the classroom (row[4]) */
Str_Copy (Cla->Location,row[4],
Cla_MAX_BYTES_LOCATION);
/* Get the full name of the classroom (row[4]) */
Str_Copy (Cla->Location,row[4],
Cla_MAX_BYTES_LOCATION);
}
}
}
else

View File

@ -66,6 +66,13 @@ typedef enum
} Cla_Order_t;
#define Cla_ORDER_DEFAULT Cla_ORDER_BY_LOCATION
/***** Get all data or only short name *****/
typedef enum
{
Cla_ALL_DATA,
Cla_ONLY_SHRT_NAME,
} Cla_WhichData_t;
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/
@ -73,8 +80,11 @@ typedef enum
void Cla_SeeClassrooms (void);
void Cla_EditClassrooms (void);
void Cla_PutIconToViewClassrooms (void);
void Cla_GetListClassrooms (void);
void Cla_GetListClassrooms (Cla_WhichData_t WhichData);
void Cla_FreeListClassrooms (void);
void Cla_GetListClassroomsInThisCtr (void);
void Cla_GetDataOfClassroomByCod (struct Classroom *Cla);
long Cla_GetParamClaCod (void);

View File

@ -475,6 +475,7 @@ struct Globals
struct GroupType GrpTyp;
long GrpCod; // Group to be edited, removed...
char GrpName[Grp_MAX_BYTES_GROUP_NAME + 1];
long ClaCod;
unsigned MaxStudents;
bool Open;
bool FileZones;

View File

@ -232,6 +232,9 @@ static void Grp_ReqEditGroupsInternal1 (Ale_AlertType_t AlertTypeGroupTypes,cons
/***** Get list of groups types and groups in this course *****/
Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ALL_GROUP_TYPES);
/***** Get list of classrooms in this centre *****/
Cla_GetListClassrooms (Cla_ONLY_SHRT_NAME);
/***** Show optional alert *****/
if (MessageGroupTypes)
if (MessageGroupTypes[0])
@ -261,6 +264,9 @@ static void Grp_ReqEditGroupsInternal2 (Ale_AlertType_t AlertTypeGroups,const ch
/***** End groups section *****/
Lay_EndSection ();
/***** Free list of classrooms in this centre *****/
Cla_FreeListClassrooms ();
/***** Free list of groups types and groups in this course *****/
Grp_FreeListGrpTypesAndGrps ();
}
@ -1572,7 +1578,7 @@ static void Grp_ListGroupsForEdition (void)
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">");
Frm_StartFormAnchor (ActChgGrpTyp,Grp_GROUPS_SECTION_ID);
Grp_PutParamGrpCod (Grp->GrpCod);
fprintf (Gbl.F.Out,"<select name=\"GrpTypCod\" style=\"width:150px;\""
fprintf (Gbl.F.Out,"<select name=\"GrpTypCod\" style=\"width:100px;\""
" onchange=\"document.getElementById('%s').submit();\">",
Gbl.Form.Id);
for (NumTipGrpAux = 0;
@ -1594,7 +1600,7 @@ static void Grp_ListGroupsForEdition (void)
Frm_StartFormAnchor (ActRenGrp,Grp_GROUPS_SECTION_ID);
Grp_PutParamGrpCod (Grp->GrpCod);
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"GrpName\""
" size=\"40\" maxlength=\"%u\" value=\"%s\""
" size=\"20\" maxlength=\"%u\" value=\"%s\""
" onchange=\"document.getElementById('%s').submit();\" />",
Grp_MAX_CHARS_GROUP_NAME,Grp->GrpName,Gbl.Form.Id);
Frm_EndForm ();
@ -1637,6 +1643,7 @@ static void Grp_WriteHeadingGroups (void)
extern const char *Txt_Type_BR_of_group;
extern const char *Txt_Group_name;
extern const char *Txt_eg_A_B;
extern const char *Txt_Classroom;
extern const char *Txt_ROLES_PLURAL_BRIEF_Abc[Rol_NUM_ROLES];
extern const char *Txt_Max_BR_students;
Rol_Role_t Role;
@ -1650,9 +1657,13 @@ static void Grp_WriteHeadingGroups (void)
"</th>"
"<th class=\"CENTER_MIDDLE\">"
"%s<br />(%s)"
"</th>"
"<th class=\"CENTER_MIDDLE\">"
"%s"
"</th>",
Txt_Type_BR_of_group,
Txt_Group_name,Txt_eg_A_B);
Txt_Group_name,Txt_eg_A_B,
Txt_Classroom);
for (Role = Rol_TCH;
Role >= Rol_STD;
Role--)
@ -2583,8 +2594,10 @@ static void Grp_PutFormToCreateGroup (void)
extern const char *Txt_New_group;
extern const char *Txt_Group_closed;
extern const char *Txt_File_zones_disabled;
extern const char *Txt_Another_classroom;
extern const char *Txt_Create_group;
unsigned NumGrpTyp;
unsigned NumCla;
Rol_Role_t Role;
/***** Start form *****/
@ -2620,7 +2633,7 @@ static void Grp_PutFormToCreateGroup (void)
/***** Group type *****/
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">"
"<select name=\"GrpTypCod\" style=\"width:150px;\">");
"<select name=\"GrpTypCod\" style=\"width:100px;\">");
for (NumGrpTyp = 0;
NumGrpTyp < Gbl.CurrentCrs.Grps.GrpTypes.Num;
NumGrpTyp++)
@ -2638,11 +2651,37 @@ static void Grp_PutFormToCreateGroup (void)
/***** Group name *****/
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">"
"<input type=\"text\" name=\"GrpName\""
" size=\"40\" maxlength=\"%u\" value=\"%s\""
" size=\"20\" maxlength=\"%u\" value=\"%s\""
" required=\"required\" />"
"</td>",
Grp_MAX_CHARS_GROUP_NAME,Gbl.CurrentCrs.Grps.GrpName);
/***** Classroom *****/
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">"
"<select name=\"ClaCod\" style=\"width:100px;\">"
"<option value=\"-1\"");
if (Gbl.CurrentCrs.Grps.ClaCod < 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out," disabled=\"disabled\"></option>"
"<option value=\"0\"");
if (Gbl.CurrentCrs.Grps.ClaCod == 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s</option>",
Txt_Another_classroom);
for (NumCla = 0;
NumCla < Gbl.Classrooms.Num;
NumCla++)
{
fprintf (Gbl.F.Out,"<option value=\"%ld\"",
Gbl.Classrooms.Lst[NumCla].ClaCod);
if (Gbl.Classrooms.Lst[NumCla].ClaCod == Gbl.CurrentCrs.Grps.ClaCod)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s</option>",
Gbl.Classrooms.Lst[NumCla].ShrtName);
}
fprintf (Gbl.F.Out,"</select>"
"</td>");
/***** Current number of users in this group *****/
for (Role = Rol_TCH;
Role >= Rol_STD;

View File

@ -1642,6 +1642,27 @@ const char *Txt_Another_centre =
"Outro centro";
#endif
const char *Txt_Another_classroom =
#if L==1 // ca
"Una altra aula";
#elif L==2 // de
"Eine weitere Klassenzimmer";
#elif L==3 // en
"Another classroom";
#elif L==4 // es
"Otra aula";
#elif L==5 // fr
"Un autre salle de classe";
#elif L==6 // gn
"Otra aula"; // Okoteve traducción
#elif L==7 // it
"Un'altra aula";
#elif L==8 // pl
"Kolejna klasa";
#elif L==9 // pt
"Outra sala de aula";
#endif
const char *Txt_Another_country =
#if L==1 // ca
"Un altre pa&iacute;s";
@ -1705,6 +1726,48 @@ const char *Txt_Another_ID =
"Outro n&ordm; de identif.";
#endif
const char *Txt_Another_institution =
#if L==1 // ca
"Una altra instituci&oacute;";
#elif L==2 // de
"Eine weitere Hochschule";
#elif L==3 // en
"Another institution";
#elif L==4 // es
"Otra instituci&oacute;n";
#elif L==5 // fr
"Un autre &eacute;tablissement";
#elif L==6 // gn
"Otra instituci&oacute;n"; // Okoteve traducción
#elif L==7 // it
"Un'altra istituzione";
#elif L==8 // pl
"Kolejna instytucja";
#elif L==9 // pt
"Outra institui&ccedil;&atilde;o";
#endif
const char *Txt_Another_place =
#if L==1 // ca
"Un altre lloc";
#elif L==2 // de
"Ein weiterer Standort";
#elif L==3 // en
"Another place";
#elif L==4 // es
"Otro lugar";
#elif L==5 // fr
"Un autre emplacement";
#elif L==6 // gn
"Otro lugar"; // Okoteve traducción
#elif L==7 // it
"Un'altra localit&grave;";
#elif L==8 // pl
"Innym miejscem";
#elif L==9 // pt
"Outra localiza&ccedil;&atilde;o";
#endif
const char *Txt_Another_user_s_profile =
#if L==1 // ca
"Perfil d'un altre usuari";
@ -1831,48 +1894,6 @@ const char *Txt_Announcement_removed =
"An&uacute;ncio removido.";
#endif
const char *Txt_Another_institution =
#if L==1 // ca
"Una altra instituci&oacute;";
#elif L==2 // de
"Eine weitere Hochschule";
#elif L==3 // en
"Another institution";
#elif L==4 // es
"Otra instituci&oacute;n";
#elif L==5 // fr
"Un autre &eacute;tablissement";
#elif L==6 // gn
"Otra instituci&oacute;n"; // Okoteve traducción
#elif L==7 // it
"Un'altra istituzione";
#elif L==8 // pl
"Kolejna instytucja";
#elif L==9 // pt
"Outra institui&ccedil;&atilde;o";
#endif
const char *Txt_Another_place =
#if L==1 // ca
"Un altre lloc";
#elif L==2 // de
"Ein weiterer Standort";
#elif L==3 // en
"Another place";
#elif L==4 // es
"Otro lugar";
#elif L==5 // fr
"Un autre emplacement";
#elif L==6 // gn
"Otro lugar"; // Okoteve traducción
#elif L==7 // it
"Un'altra localit&grave;";
#elif L==8 // pl
"Innym miejscem";
#elif L==9 // pt
"Outra localiza&ccedil;&atilde;o";
#endif
const char *Txt_Answer_survey =
#if L==1 // ca
"Respondre enquesta";
@ -5403,7 +5424,7 @@ const char *Txt_Create_another_centre =
#elif L==7 // it
"Crea un altro centro";
#elif L==8 // pl
"Tworzenie inny centrum";
"Utw&oacute;rz inny centrum";
#elif L==9 // pt
"Criar outro centro";
#endif
@ -5424,7 +5445,7 @@ const char *Txt_Create_another_course =
#elif L==7 // it
"Crea un altro corso";
#elif L==8 // pl
"Tworzenie inny kursu";
"Utw&oacute;rz inny kursu";
#elif L==9 // pt
"Criar outra disciplina";
#endif
@ -5445,7 +5466,7 @@ const char *Txt_Create_another_degree =
#elif L==7 // it
"Crea una altra laurea";
#elif L==8 // pl
"Tworzenie inny stopnia";
"Utw&oacute;rz inny stopnia";
#elif L==9 // pt
"Criar outro grau";
#endif
@ -5466,7 +5487,7 @@ const char *Txt_Create_another_institution =
#elif L==7 // it
"Crea una altra istituzione";
#elif L==8 // pl
"Tworzenie inny instytucji";
"Utw&oacute;rz inny instytucji";
#elif L==9 // pt
"Criar outra institu&ccedil;&atilde;o";
#endif
@ -5487,7 +5508,7 @@ const char *Txt_Create_another_type_of_degree =
#elif L==7 // it
"Crea un altro tipo di laurea";
#elif L==8 // pl
"Tworzenie inny typu stopnia";
"Utw&oacute;rz inny typu stopnia";
#elif L==9 // pt
"Criar outro tipo de grau";
#endif
@ -5550,7 +5571,7 @@ const char *Txt_Create_centre =
#elif L==7 // it
"Crea centro";
#elif L==8 // pl
"Tworzenie centrum";
"Utw&oacute;rz centrum";
#elif L==9 // pt
"Criar centro";
#endif
@ -5571,7 +5592,7 @@ const char *Txt_Create_classroom =
#elif L==7 // it
"Crea aula";
#elif L==8 // pl
"Tworzenie klasa";
"Utw&oacute;rz klasa";
#elif L==9 // pt
"Criar sala de aula";
#endif
@ -5592,7 +5613,7 @@ const char *Txt_Create_country =
#elif L==7 // it
"Crea paese";
#elif L==8 // pl
"Tworzenie kraju";
"Utw&oacute;rz kraju";
#elif L==9 // pt
"Criar pa&iacute;s";
#endif
@ -5613,7 +5634,7 @@ const char *Txt_Create_course =
#elif L==7 // it
"Crea corso";
#elif L==8 // pl
"Tworzenie kursu";
"Utw&oacute;rz kursu";
#elif L==9 // pt
"Criar disciplina";
#endif
@ -5634,7 +5655,7 @@ const char *Txt_Create_degree =
#elif L==7 // it
"Crea laurea";
#elif L==8 // pl
"Tworzenie stopnia";
"Utw&oacute;rz stopnia";
#elif L==9 // pt
"Criar grau";
#endif
@ -5655,7 +5676,7 @@ const char *Txt_Create_department =
#elif L==7 // it
"Crea dipartimento";
#elif L==8 // pl
"Tworzenie dzia&lstrok;u";
"Utw&oacute;rz dzia&lstrok;u";
#elif L==9 // pt
"Criar departamento";
#endif
@ -5676,7 +5697,7 @@ const char *Txt_Create_email_domain =
#elif L==7 // it
"Crea campo mail";
#elif L==8 // pl
"Tworzenie domeny mail";
"Utw&oacute;rz domeny mail";
#elif L==9 // pt
"Criar dom&iacute;nio de email";
#endif
@ -5697,7 +5718,7 @@ const char *Txt_Create_email_message =
#elif L==7 // it
"Crea messaggio email";
#elif L==8 // pl
"Tworzenie wiadomosci email";
"Utw&oacute;rz wiadomosci email";
#elif L==9 // pt
"Criar uma mensagem de email";
#endif
@ -5760,14 +5781,14 @@ const char *Txt_Create_game =
#elif L==7 // it
"Crea gioco";
#elif L==8 // pl
"Tworzenie gra";
"Utw&oacute;rz gra";
#elif L==9 // pt
"Criar jogo";
#endif
const char *Txt_Create_group =
#if L==1 // ca
"Crear grupo"; // Necessita traduccio
"Crear grup";
#elif L==2 // de
"Gruppe erstellen";
#elif L==3 // en
@ -5781,7 +5802,7 @@ const char *Txt_Create_group =
#elif L==7 // it
"Crea gruppo";
#elif L==8 // pl
"Create group"; // Potrzebujesz tlumaczenie
"Utw&oacute;rz grup&eogon;";
#elif L==9 // pt
"Criar grupo";
#endif
@ -5802,7 +5823,7 @@ const char *Txt_Create_holiday =
#elif L==7 // it
"Crea festivit&agrave;";
#elif L==8 // pl
"Tworzenie wakacje";
"Utw&oacute;rz wakacje";
#elif L==9 // pt
"Criar f&eacute;ria";
#endif
@ -5823,7 +5844,7 @@ const char *Txt_Create_institution =
#elif L==7 // it
"Crea istituzione";
#elif L==8 // pl
"Tworzenie instytucji";
"Utw&oacute;rz instytucji";
#elif L==9 // pt
"Criar institu&ccedil;&atilde;o";
#endif
@ -5865,7 +5886,7 @@ const char *Txt_Create_notice =
#elif L==7 // it
"Crea avviso";
#elif L==8 // pl
"Stw&oacute;rz powiadomienie";
"Utw&oacute;rz powiadomienie";
#elif L==9 // pt
"Criar aviso";
#endif
@ -5886,7 +5907,7 @@ const char *Txt_Create_BR_notification =
#elif L==7 // it
"Crea<br />notifica";
#elif L==8 // pl
"Tworzenie<br />powiadomienie";
"Utw&oacute;rz<br />powiadomienie";
#elif L==9 // pt
"Criar<br />notifica&ccedil;&atilde;o";
#endif
@ -5928,7 +5949,7 @@ const char *Txt_Create_place =
#elif L==7 // it
"Crea localit&grave;";
#elif L==8 // pl
"Tworzenie miejsce";
"Utw&oacute;rz miejsce";
#elif L==9 // pt
"Criar localiza&ccedil;&atilde;o";
#endif
@ -5949,7 +5970,7 @@ const char *Txt_Create_plugin =
#elif L==7 // it
"Crea plugin";
#elif L==8 // pl
"Tworzenie plugin";
"Utw&oacute;rz plugin";
#elif L==9 // pt
"Criar plugin";
#endif
@ -5970,7 +5991,7 @@ const char *Txt_Create_project =
#elif L==7 // it
"Crea progetto";
#elif L==8 // pl
"Tworzenie projekt";
"Utw&oacute;rz projekt";
#elif L==9 // pt
"Criar projeto";
#endif
@ -5991,7 +6012,7 @@ const char *Txt_Create_question =
#elif L==7 // it
"Crea domanda";
#elif L==8 // pl
"Tworzenie pytanie";
"Utw&oacute;rz pytanie";
#elif L==9 // pt
"Criar quest&atilde;o";
#endif
@ -6033,7 +6054,7 @@ const char *Txt_Create_survey =
#elif L==7 // it
"Crea sondaggio";
#elif L==8 // pl
"Tworzenie ankiety";
"Utw&oacute;rz ankiety";
#elif L==9 // pt
"Criar inqu&eacute;rito";
#endif
@ -6054,7 +6075,7 @@ const char *Txt_Create_type_of_degree =
#elif L==7 // it
"Crea tipo di laurea";
#elif L==8 // pl
"Tworzenie typu stopnia";
"Utw&oacute;rz typu stopnia";
#elif L==9 // pt
"Criar tipo de grau";
#endif
@ -6075,7 +6096,7 @@ const char *Txt_Create_type_of_group =
#elif L==7 // it
"Crea tipo di gruppo";
#elif L==8 // pl
"Tworzenie typu grupy";
"Utw&oacute;rz typu grupy";
#elif L==9 // pt
"Criar tipo de grupo";
#endif
@ -6096,7 +6117,7 @@ const char *Txt_Create_ZIP_file =
#elif L==7 // it
"Crea file ZIP";
#elif L==8 // pl
"Tworzenie pliku ZIP";
"Utw&oacute;rz pliku ZIP";
#elif L==9 // pt
"Criar arquivo ZIP";
#endif
@ -6621,7 +6642,7 @@ const char *Txt_Creating_database_tables_if_they_do_not_exist =
#elif L==7 // it
"Creazione tabelle della base di dati se non esistono&hellip;";
#elif L==8 // pl
"Tworzenie tabel bazy danych, jesli ich nie ma &hellip;";
"Utw&oacute;rz tabel bazy danych, jesli ich nie ma &hellip;";
#elif L==9 // pt
"Criando tabelas da base de dados, se elas n&atilde;o existirem&hellip;";
#endif