mirror of
https://github.com/acanas/swad-core.git
synced 2024-05-31 05:45:24 +02:00
Version 15.66
This commit is contained in:
parent
3b3cddb5d3
commit
3681e3281c
|
@ -708,18 +708,22 @@ static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr)
|
||||||
Ctr->NumCrss);
|
Ctr->NumCrss);
|
||||||
|
|
||||||
/***** Number of teachers in courses of this centre *****/
|
/***** Number of teachers in courses of this centre *****/
|
||||||
|
/*
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
|
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
|
||||||
"%u"
|
"%u"
|
||||||
"</td>",
|
"</td>",
|
||||||
TxtClassNormal,BgColor,
|
TxtClassNormal,BgColor,
|
||||||
Ctr->NumTchs);
|
Ctr->NumTchs);
|
||||||
|
*/
|
||||||
|
|
||||||
/***** Number of students in courses of this centre *****/
|
/***** Number of students in courses of this centre *****/
|
||||||
|
/*
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
|
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
|
||||||
"%u"
|
"%u"
|
||||||
"</td>",
|
"</td>",
|
||||||
TxtClassNormal,BgColor,
|
TxtClassNormal,BgColor,
|
||||||
Ctr->NumStds);
|
Ctr->NumStds);
|
||||||
|
*/
|
||||||
|
|
||||||
/***** Number of users in courses of this centre *****/
|
/***** Number of users in courses of this centre *****/
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
|
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
|
||||||
|
@ -906,8 +910,8 @@ void Ctr_GetListCentres (long InsCod)
|
||||||
|
|
||||||
/* Get number of users in courses of this centre */
|
/* Get number of users in courses of this centre */
|
||||||
Ctr->NumUsrs = Usr_GetNumUsrsInCrssOfCtr (Rol_UNKNOWN,Ctr->CtrCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
|
Ctr->NumUsrs = Usr_GetNumUsrsInCrssOfCtr (Rol_UNKNOWN,Ctr->CtrCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
|
||||||
Ctr->NumTchs = Usr_GetNumUsrsInCrssOfCtr (Rol_TEACHER,Ctr->CtrCod);
|
// Ctr->NumTchs = Usr_GetNumUsrsInCrssOfCtr (Rol_TEACHER,Ctr->CtrCod);
|
||||||
Ctr->NumStds = Usr_GetNumUsrsInCrssOfCtr (Rol_STUDENT,Ctr->CtrCod);
|
// Ctr->NumStds = Usr_GetNumUsrsInCrssOfCtr (Rol_STUDENT,Ctr->CtrCod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -940,8 +944,8 @@ bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr)
|
||||||
Ctr->NumDegs = 0;
|
Ctr->NumDegs = 0;
|
||||||
Ctr->NumCrss = 0;
|
Ctr->NumCrss = 0;
|
||||||
Ctr->NumUsrs = 0;
|
Ctr->NumUsrs = 0;
|
||||||
Ctr->NumTchs = 0;
|
// Ctr->NumTchs = 0;
|
||||||
Ctr->NumStds = 0;
|
// Ctr->NumStds = 0;
|
||||||
|
|
||||||
/***** Check if centre code is correct *****/
|
/***** Check if centre code is correct *****/
|
||||||
if (Ctr->CtrCod > 0)
|
if (Ctr->CtrCod > 0)
|
||||||
|
@ -1005,8 +1009,8 @@ bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr)
|
||||||
|
|
||||||
/* Get number of users in courses of this centre */
|
/* Get number of users in courses of this centre */
|
||||||
Ctr->NumUsrs = Usr_GetNumUsrsInCrssOfCtr (Rol_UNKNOWN,Ctr->CtrCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
|
Ctr->NumUsrs = Usr_GetNumUsrsInCrssOfCtr (Rol_UNKNOWN,Ctr->CtrCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
|
||||||
Ctr->NumTchs = Usr_GetNumUsrsInCrssOfCtr (Rol_TEACHER,Ctr->CtrCod);
|
// Ctr->NumTchs = Usr_GetNumUsrsInCrssOfCtr (Rol_TEACHER,Ctr->CtrCod);
|
||||||
Ctr->NumStds = Usr_GetNumUsrsInCrssOfCtr (Rol_STUDENT,Ctr->CtrCod);
|
// Ctr->NumStds = Usr_GetNumUsrsInCrssOfCtr (Rol_STUDENT,Ctr->CtrCod);
|
||||||
|
|
||||||
/* Set return value */
|
/* Set return value */
|
||||||
CtrFound = true;
|
CtrFound = true;
|
||||||
|
@ -1399,16 +1403,20 @@ static void Ctr_ListCentresForEdition (void)
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
/* Number of teachers */
|
/* Number of teachers */
|
||||||
|
/*
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
|
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
|
||||||
"%u"
|
"%u"
|
||||||
"</td>",
|
"</td>",
|
||||||
Ctr->NumTchs);
|
Ctr->NumTchs);
|
||||||
|
*/
|
||||||
|
|
||||||
/* Number of degrees */
|
/* Number of degrees */
|
||||||
|
/*
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
|
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
|
||||||
"%u"
|
"%u"
|
||||||
"</td>",
|
"</td>",
|
||||||
Ctr->NumDegs);
|
Ctr->NumDegs);
|
||||||
|
*/
|
||||||
|
|
||||||
/* Centre status */
|
/* Centre status */
|
||||||
StatusTxt = Ctr_GetStatusTxtFromStatusBits (Ctr->Status);
|
StatusTxt = Ctr_GetStatusTxtFromStatusBits (Ctr->Status);
|
||||||
|
@ -1559,7 +1567,8 @@ void Ctr_RemoveCentre (void)
|
||||||
|
|
||||||
/***** Check if this centre has teachers *****/
|
/***** Check if this centre has teachers *****/
|
||||||
if (Ctr.NumDegs ||
|
if (Ctr.NumDegs ||
|
||||||
Ctr.NumTchs) // Centre has degrees or teachers ==> don't remove
|
Ctr.NumUsrsWhoClaimToBelongToCtr ||
|
||||||
|
Ctr.NumUsrs) // Centre has degrees or users ==> don't remove
|
||||||
Lay_ShowAlert (Lay_WARNING,Txt_To_remove_a_centre_you_must_first_remove_all_degrees_and_teachers_in_the_centre);
|
Lay_ShowAlert (Lay_WARNING,Txt_To_remove_a_centre_you_must_first_remove_all_degrees_and_teachers_in_the_centre);
|
||||||
else // Centre has no teachers ==> remove it
|
else // Centre has no teachers ==> remove it
|
||||||
{
|
{
|
||||||
|
@ -2225,12 +2234,12 @@ static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable)
|
||||||
"<th class=\"LEFT_MIDDLE\">"
|
"<th class=\"LEFT_MIDDLE\">"
|
||||||
"%s"
|
"%s"
|
||||||
"</th>"
|
"</th>"
|
||||||
"<th class=\"LEFT_MIDDLE\">"
|
// "<th class=\"LEFT_MIDDLE\">"
|
||||||
"%s"
|
// "%s"
|
||||||
"</th>"
|
// "</th>"
|
||||||
"<th class=\"LEFT_MIDDLE\">"
|
// "<th class=\"LEFT_MIDDLE\">"
|
||||||
"%s"
|
// "%s"
|
||||||
"</th>"
|
// "</th>"
|
||||||
"<th class=\"LEFT_MIDDLE\">"
|
"<th class=\"LEFT_MIDDLE\">"
|
||||||
"%s+<br />%s"
|
"%s+<br />%s"
|
||||||
"</th>"
|
"</th>"
|
||||||
|
@ -2241,8 +2250,8 @@ static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable)
|
||||||
Txt_Place,
|
Txt_Place,
|
||||||
Txt_Degrees_ABBREVIATION,
|
Txt_Degrees_ABBREVIATION,
|
||||||
Txt_Courses_ABBREVIATION,
|
Txt_Courses_ABBREVIATION,
|
||||||
Txt_Teachers_ABBREVIATION,
|
// Txt_Teachers_ABBREVIATION,
|
||||||
Txt_Students_ABBREVIATION,
|
// Txt_Students_ABBREVIATION,
|
||||||
Txt_Teachers_ABBREVIATION,
|
Txt_Teachers_ABBREVIATION,
|
||||||
Txt_Students_ABBREVIATION,
|
Txt_Students_ABBREVIATION,
|
||||||
Txt_Status);
|
Txt_Status);
|
||||||
|
@ -2560,7 +2569,7 @@ unsigned Ctr_ListCtrsFound (const char *Query)
|
||||||
|
|
||||||
/* Number of centres found */
|
/* Number of centres found */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<th colspan=\"7\" class=\"CENTER_MIDDLE\">");
|
"<th colspan=\"8\" class=\"CENTER_MIDDLE\">");
|
||||||
if (NumCtrs == 1)
|
if (NumCtrs == 1)
|
||||||
fprintf (Gbl.F.Out,"1 %s",Txt_centre);
|
fprintf (Gbl.F.Out,"1 %s",Txt_centre);
|
||||||
else
|
else
|
||||||
|
|
|
@ -71,8 +71,8 @@ struct Centre
|
||||||
unsigned NumDegs; // Number of degrees in this centre
|
unsigned NumDegs; // Number of degrees in this centre
|
||||||
unsigned NumCrss; // Number of courses in this centre
|
unsigned NumCrss; // Number of courses in this centre
|
||||||
unsigned NumUsrs; // Number of users in courses of this centre
|
unsigned NumUsrs; // Number of users in courses of this centre
|
||||||
unsigned NumTchs; // Number of teachers in courses of this centre
|
// unsigned NumTchs; // Number of teachers in courses of this centre
|
||||||
unsigned NumStds; // Number of students in courses of this centre
|
// unsigned NumStds; // Number of students in courses of this centre
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
|
@ -114,17 +114,19 @@
|
||||||
// TODO: Reply to all
|
// TODO: Reply to all
|
||||||
// TODO: Reply icons should appear without text
|
// TODO: Reply icons should appear without text
|
||||||
// TODO: Link to remove messages is too wide. For example: "Remove these X messages".
|
// TODO: Link to remove messages is too wide. For example: "Remove these X messages".
|
||||||
|
// TODO: Remove old files in briefcase!!!!! Disk almost full!!!!!
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 15.65.1 (2015/12/14)"
|
#define Log_PLATFORM_VERSION "SWAD 15.66 (2015/12/14)"
|
||||||
#define CSS_FILE "swad15.65.1.css"
|
#define CSS_FILE "swad15.65.1.css"
|
||||||
|
|
||||||
// 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 15.66: Dec 14, 2015 Number of teachers and number of students removed from list of countries, institutions and centres by reasons of speed. (187057 lines)
|
||||||
Version 15.65.1: Dec 14, 2015 Changes in layout of profile. (187031 lines)
|
Version 15.65.1: Dec 14, 2015 Changes in layout of profile. (187031 lines)
|
||||||
Version 15.65: Dec 13, 2015 Change in layout of contextual links. (187009 lines)
|
Version 15.65: Dec 13, 2015 Change in layout of contextual links. (187009 lines)
|
||||||
Version 15.64.18: Dec 13, 2015 Code refactoring in contextual links. (187004 lines)
|
Version 15.64.18: Dec 13, 2015 Code refactoring in contextual links. (187004 lines)
|
||||||
|
|
|
@ -536,12 +536,12 @@ void Cty_ListCountries2 (void)
|
||||||
"<th class=\"RIGHT_MIDDLE\">"
|
"<th class=\"RIGHT_MIDDLE\">"
|
||||||
"%s"
|
"%s"
|
||||||
"</th>"
|
"</th>"
|
||||||
"<th class=\"RIGHT_MIDDLE\">"
|
// "<th class=\"RIGHT_MIDDLE\">"
|
||||||
"%s"
|
// "%s"
|
||||||
"</th>"
|
// "</th>"
|
||||||
"<th class=\"RIGHT_MIDDLE\">"
|
// "<th class=\"RIGHT_MIDDLE\">"
|
||||||
"%s"
|
// "%s"
|
||||||
"</th>"
|
// "</th>"
|
||||||
"<th class=\"RIGHT_MIDDLE\">"
|
"<th class=\"RIGHT_MIDDLE\">"
|
||||||
"%s+<br />%s"
|
"%s+<br />%s"
|
||||||
"</th>"
|
"</th>"
|
||||||
|
@ -550,8 +550,8 @@ void Cty_ListCountries2 (void)
|
||||||
Txt_Centres_ABBREVIATION,
|
Txt_Centres_ABBREVIATION,
|
||||||
Txt_Degrees_ABBREVIATION,
|
Txt_Degrees_ABBREVIATION,
|
||||||
Txt_Courses_ABBREVIATION,
|
Txt_Courses_ABBREVIATION,
|
||||||
Txt_Teachers_ABBREVIATION,
|
// Txt_Teachers_ABBREVIATION,
|
||||||
Txt_Students_ABBREVIATION,
|
// Txt_Students_ABBREVIATION,
|
||||||
Txt_Teachers_ABBREVIATION,
|
Txt_Teachers_ABBREVIATION,
|
||||||
Txt_Students_ABBREVIATION);
|
Txt_Students_ABBREVIATION);
|
||||||
|
|
||||||
|
@ -587,12 +587,12 @@ void Cty_ListCountries2 (void)
|
||||||
"<td class=\"DAT RIGHT_MIDDLE %s\">"
|
"<td class=\"DAT RIGHT_MIDDLE %s\">"
|
||||||
"%u"
|
"%u"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"DAT RIGHT_MIDDLE %s\">"
|
// "<td class=\"DAT RIGHT_MIDDLE %s\">"
|
||||||
"%u"
|
// "%u"
|
||||||
"</td>"
|
// "</td>"
|
||||||
"<td class=\"DAT RIGHT_MIDDLE %s\">"
|
// "<td class=\"DAT RIGHT_MIDDLE %s\">"
|
||||||
"%u"
|
// "%u"
|
||||||
"</td>"
|
// "</td>"
|
||||||
"<td class=\"DAT RIGHT_MIDDLE %s\">"
|
"<td class=\"DAT RIGHT_MIDDLE %s\">"
|
||||||
"%u"
|
"%u"
|
||||||
"</td>"
|
"</td>"
|
||||||
|
@ -602,8 +602,8 @@ void Cty_ListCountries2 (void)
|
||||||
BgColor,Gbl.Ctys.Lst[NumCty].NumCtrs,
|
BgColor,Gbl.Ctys.Lst[NumCty].NumCtrs,
|
||||||
BgColor,Gbl.Ctys.Lst[NumCty].NumDegs,
|
BgColor,Gbl.Ctys.Lst[NumCty].NumDegs,
|
||||||
BgColor,Gbl.Ctys.Lst[NumCty].NumCrss,
|
BgColor,Gbl.Ctys.Lst[NumCty].NumCrss,
|
||||||
BgColor,Gbl.Ctys.Lst[NumCty].NumTchs,
|
// BgColor,Gbl.Ctys.Lst[NumCty].NumTchs,
|
||||||
BgColor,Gbl.Ctys.Lst[NumCty].NumStds,
|
// BgColor,Gbl.Ctys.Lst[NumCty].NumStds,
|
||||||
BgColor,Gbl.Ctys.Lst[NumCty].NumUsrs);
|
BgColor,Gbl.Ctys.Lst[NumCty].NumUsrs);
|
||||||
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
||||||
}
|
}
|
||||||
|
@ -635,12 +635,12 @@ void Cty_ListCountries2 (void)
|
||||||
"<td class=\"DAT RIGHT_MIDDLE\">"
|
"<td class=\"DAT RIGHT_MIDDLE\">"
|
||||||
"%u"
|
"%u"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"DAT RIGHT_MIDDLE\">"
|
// "<td class=\"DAT RIGHT_MIDDLE\">"
|
||||||
"%u"
|
// "%u"
|
||||||
"</td>"
|
// "</td>"
|
||||||
"<td class=\"DAT RIGHT_MIDDLE\">"
|
// "<td class=\"DAT RIGHT_MIDDLE\">"
|
||||||
"%u"
|
// "%u"
|
||||||
"</td>"
|
// "</td>"
|
||||||
"<td class=\"DAT RIGHT_MIDDLE\">"
|
"<td class=\"DAT RIGHT_MIDDLE\">"
|
||||||
"%u"
|
"%u"
|
||||||
"</td>"
|
"</td>"
|
||||||
|
@ -651,8 +651,8 @@ void Cty_ListCountries2 (void)
|
||||||
Ctr_GetNumCtrsInCty (0),
|
Ctr_GetNumCtrsInCty (0),
|
||||||
Deg_GetNumDegsInCty (0),
|
Deg_GetNumDegsInCty (0),
|
||||||
Crs_GetNumCrssInCty (0),
|
Crs_GetNumCrssInCty (0),
|
||||||
Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,0),
|
// Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,0),
|
||||||
Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,0),
|
// Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,0),
|
||||||
Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,0));
|
Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,0));
|
||||||
|
|
||||||
/***** Write users and institutions with unknown country *****/
|
/***** Write users and institutions with unknown country *****/
|
||||||
|
@ -675,12 +675,12 @@ void Cty_ListCountries2 (void)
|
||||||
"<td class=\"DAT RIGHT_MIDDLE\">"
|
"<td class=\"DAT RIGHT_MIDDLE\">"
|
||||||
"%u"
|
"%u"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"DAT RIGHT_MIDDLE\">"
|
// "<td class=\"DAT RIGHT_MIDDLE\">"
|
||||||
"0"
|
// "0"
|
||||||
"</td>"
|
// "</td>"
|
||||||
"<td class=\"DAT RIGHT_MIDDLE\">"
|
// "<td class=\"DAT RIGHT_MIDDLE\">"
|
||||||
"0"
|
// "0"
|
||||||
"</td>"
|
// "</td>"
|
||||||
"<td class=\"DAT RIGHT_MIDDLE\">"
|
"<td class=\"DAT RIGHT_MIDDLE\">"
|
||||||
"0"
|
"0"
|
||||||
"</td>"
|
"</td>"
|
||||||
|
@ -1020,7 +1020,8 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
|
||||||
}
|
}
|
||||||
Cty->NumUsrsWhoClaimToBelongToCty = 0;
|
Cty->NumUsrsWhoClaimToBelongToCty = 0;
|
||||||
Cty->NumInss = Cty->NumCtrs = Cty->NumDegs = Cty->NumCrss = 0;
|
Cty->NumInss = Cty->NumCtrs = Cty->NumDegs = Cty->NumCrss = 0;
|
||||||
Cty->NumUsrs = Cty->NumTchs = Cty->NumStds = 0;
|
// Cty->NumUsrs = Cty->NumTchs = Cty->NumStds = 0;
|
||||||
|
Cty->NumUsrs = 0;
|
||||||
|
|
||||||
/* Get the name of the country in current language */
|
/* Get the name of the country in current language */
|
||||||
strcpy (Cty->Name[Gbl.Prefs.Language],row[2]);
|
strcpy (Cty->Name[Gbl.Prefs.Language],row[2]);
|
||||||
|
@ -1053,8 +1054,8 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
|
||||||
|
|
||||||
/* Get number of users in courses of this country */
|
/* Get number of users in courses of this country */
|
||||||
Cty->NumUsrs = Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,Cty->CtyCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
|
Cty->NumUsrs = Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,Cty->CtyCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
|
||||||
Cty->NumStds = Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,Cty->CtyCod);
|
// Cty->NumStds = Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,Cty->CtyCod);
|
||||||
Cty->NumTchs = Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,Cty->CtyCod);
|
// Cty->NumTchs = Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,Cty->CtyCod);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1181,8 +1182,8 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD
|
||||||
}
|
}
|
||||||
Cty->NumUsrsWhoClaimToBelongToCty = 0;
|
Cty->NumUsrsWhoClaimToBelongToCty = 0;
|
||||||
Cty->NumUsrs = 0;
|
Cty->NumUsrs = 0;
|
||||||
Cty->NumStds = 0;
|
// Cty->NumStds = 0;
|
||||||
Cty->NumTchs = 0;
|
// Cty->NumTchs = 0;
|
||||||
Cty->NumInss = 0;
|
Cty->NumInss = 0;
|
||||||
|
|
||||||
/***** Check if country code is correct *****/
|
/***** Check if country code is correct *****/
|
||||||
|
@ -1280,8 +1281,8 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD
|
||||||
|
|
||||||
/* Get number of user in courses of this institution */
|
/* Get number of user in courses of this institution */
|
||||||
Cty->NumUsrs = Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,Cty->CtyCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
|
Cty->NumUsrs = Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,Cty->CtyCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
|
||||||
Cty->NumStds = Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,Cty->CtyCod);
|
// Cty->NumStds = Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,Cty->CtyCod);
|
||||||
Cty->NumTchs = Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,Cty->CtyCod);
|
// Cty->NumTchs = Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,Cty->CtyCod);
|
||||||
|
|
||||||
/* Get number of institutions in this country */
|
/* Get number of institutions in this country */
|
||||||
Cty->NumInss = Ins_GetNumInssInCty (Cty->CtyCod);
|
Cty->NumInss = Ins_GetNumInssInCty (Cty->CtyCod);
|
||||||
|
|
|
@ -53,8 +53,8 @@ struct Country
|
||||||
unsigned NumDegs;
|
unsigned NumDegs;
|
||||||
unsigned NumCrss;
|
unsigned NumCrss;
|
||||||
unsigned NumUsrs; // Number of users in courses of the institution
|
unsigned NumUsrs; // Number of users in courses of the institution
|
||||||
unsigned NumStds; // Number of students in courses of the institution
|
// unsigned NumStds; // Number of students in courses of the institution
|
||||||
unsigned NumTchs; // Number of teachers in courses of the institution
|
// unsigned NumTchs; // Number of teachers in courses of the institution
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
|
@ -3057,7 +3057,7 @@ unsigned Crs_ListCrssFound (const char *Query)
|
||||||
|
|
||||||
/* Number of courses found */
|
/* Number of courses found */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<th colspan=\"7\" class=\"CENTER_MIDDLE\">");
|
"<th colspan=\"6\" class=\"CENTER_MIDDLE\">");
|
||||||
if (NumCrss == 1)
|
if (NumCrss == 1)
|
||||||
fprintf (Gbl.F.Out,"1 %s",Txt_course);
|
fprintf (Gbl.F.Out,"1 %s",Txt_course);
|
||||||
else
|
else
|
||||||
|
|
|
@ -3953,7 +3953,7 @@ unsigned Deg_ListDegsFound (const char *Query)
|
||||||
|
|
||||||
/* Number of degrees found */
|
/* Number of degrees found */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td colspan=\"10\" class=\"CENTER_MIDDLE\"\">");
|
"<td colspan=\"8\" class=\"CENTER_MIDDLE\"\">");
|
||||||
if (NumDegs == 1)
|
if (NumDegs == 1)
|
||||||
fprintf (Gbl.F.Out,"1 %s",Txt_degree);
|
fprintf (Gbl.F.Out,"1 %s",Txt_degree);
|
||||||
else
|
else
|
||||||
|
|
|
@ -214,8 +214,9 @@ void Gbl_InitializeGlobals (void)
|
||||||
Gbl.CurrentIns.Ins.ShortName[0] = '\0';
|
Gbl.CurrentIns.Ins.ShortName[0] = '\0';
|
||||||
Gbl.CurrentIns.Ins.FullName[0] = '\0';
|
Gbl.CurrentIns.Ins.FullName[0] = '\0';
|
||||||
Gbl.CurrentIns.Ins.WWW[0] = '\0';
|
Gbl.CurrentIns.Ins.WWW[0] = '\0';
|
||||||
Gbl.CurrentIns.Ins.NumStds = Gbl.CurrentIns.Ins.NumTchs = Gbl.CurrentIns.Ins.NumUsrs =
|
// Gbl.CurrentIns.Ins.NumStds = Gbl.CurrentIns.Ins.NumTchs = Gbl.CurrentIns.Ins.NumUsrs =
|
||||||
Gbl.CurrentIns.Ins.NumCtrs = Gbl.CurrentIns.Ins.NumDpts = Gbl.CurrentIns.Ins.NumDegs = 0;
|
Gbl.CurrentIns.Ins.NumCtrs = Gbl.CurrentIns.Ins.NumDpts = Gbl.CurrentIns.Ins.NumDegs = 0;
|
||||||
|
Gbl.CurrentIns.Ins.NumUsrs = 0;
|
||||||
|
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod = -1L;
|
Gbl.CurrentCtr.Ctr.CtrCod = -1L;
|
||||||
Gbl.CurrentCtr.Ctr.InsCod = -1L;
|
Gbl.CurrentCtr.Ctr.InsCod = -1L;
|
||||||
|
@ -243,8 +244,9 @@ void Gbl_InitializeGlobals (void)
|
||||||
Gbl.Inss.EditingIns.ShortName[0] = '\0';
|
Gbl.Inss.EditingIns.ShortName[0] = '\0';
|
||||||
Gbl.Inss.EditingIns.FullName[0] = '\0';
|
Gbl.Inss.EditingIns.FullName[0] = '\0';
|
||||||
Gbl.Inss.EditingIns.WWW[0] = '\0';
|
Gbl.Inss.EditingIns.WWW[0] = '\0';
|
||||||
Gbl.Inss.EditingIns.NumStds = Gbl.Inss.EditingIns.NumTchs = Gbl.Inss.EditingIns.NumUsrs =
|
// Gbl.Inss.EditingIns.NumStds = Gbl.Inss.EditingIns.NumTchs = Gbl.Inss.EditingIns.NumUsrs =
|
||||||
Gbl.Inss.EditingIns.NumCtrs = Gbl.Inss.EditingIns.NumDpts = Gbl.Inss.EditingIns.NumDegs = 0;
|
Gbl.Inss.EditingIns.NumCtrs = Gbl.Inss.EditingIns.NumDpts = Gbl.Inss.EditingIns.NumDegs = 0;
|
||||||
|
Gbl.Inss.EditingIns.NumUsrs = 0;
|
||||||
|
|
||||||
Gbl.Ctys.Num = 0;
|
Gbl.Ctys.Num = 0;
|
||||||
Gbl.Ctys.Lst = NULL;
|
Gbl.Ctys.Lst = NULL;
|
||||||
|
|
|
@ -639,16 +639,20 @@ static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned Nu
|
||||||
TxtClassNormal,BgColor,Ins->NumDpts);
|
TxtClassNormal,BgColor,Ins->NumDpts);
|
||||||
|
|
||||||
/* Number of teachers in courses of this institution */
|
/* Number of teachers in courses of this institution */
|
||||||
|
/*
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
|
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
|
||||||
"%u"
|
"%u"
|
||||||
"</td>",
|
"</td>",
|
||||||
TxtClassNormal,BgColor,Ins->NumTchs);
|
TxtClassNormal,BgColor,Ins->NumTchs);
|
||||||
|
*/
|
||||||
|
|
||||||
/* Number of students in courses of this institution */
|
/* Number of students in courses of this institution */
|
||||||
|
/*
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
|
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
|
||||||
"%u"
|
"%u"
|
||||||
"</td>",
|
"</td>",
|
||||||
TxtClassNormal,BgColor,Ins->NumStds);
|
TxtClassNormal,BgColor,Ins->NumStds);
|
||||||
|
*/
|
||||||
|
|
||||||
/* Number of users in courses of this institution */
|
/* Number of users in courses of this institution */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
|
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE %s\">"
|
||||||
|
@ -723,12 +727,12 @@ static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable)
|
||||||
"<th class=\"RIGHT_MIDDLE\">"
|
"<th class=\"RIGHT_MIDDLE\">"
|
||||||
"%s"
|
"%s"
|
||||||
"</th>"
|
"</th>"
|
||||||
"<th class=\"RIGHT_MIDDLE\">"
|
// "<th class=\"RIGHT_MIDDLE\">"
|
||||||
"%s"
|
// "%s"
|
||||||
"</th>"
|
// "</th>"
|
||||||
"<th class=\"RIGHT_MIDDLE\">"
|
// "<th class=\"RIGHT_MIDDLE\">"
|
||||||
"%s"
|
// "%s"
|
||||||
"</th>"
|
// "</th>"
|
||||||
"<th class=\"RIGHT_MIDDLE\">"
|
"<th class=\"RIGHT_MIDDLE\">"
|
||||||
"%s+<br />%s"
|
"%s+<br />%s"
|
||||||
"</th>"
|
"</th>"
|
||||||
|
@ -740,8 +744,8 @@ static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable)
|
||||||
Txt_Degrees_ABBREVIATION,
|
Txt_Degrees_ABBREVIATION,
|
||||||
Txt_Courses_ABBREVIATION,
|
Txt_Courses_ABBREVIATION,
|
||||||
Txt_Departments_ABBREVIATION,
|
Txt_Departments_ABBREVIATION,
|
||||||
Txt_Teachers_ABBREVIATION,
|
// Txt_Teachers_ABBREVIATION,
|
||||||
Txt_Students_ABBREVIATION,
|
// Txt_Students_ABBREVIATION,
|
||||||
Txt_Teachers_ABBREVIATION,
|
Txt_Teachers_ABBREVIATION,
|
||||||
Txt_Students_ABBREVIATION,
|
Txt_Students_ABBREVIATION,
|
||||||
Txt_Status);
|
Txt_Status);
|
||||||
|
@ -892,7 +896,8 @@ void Ins_GetListInstitutions (long CtyCod,Ins_GetExtraData_t GetExtraData)
|
||||||
case Ins_GET_BASIC_DATA:
|
case Ins_GET_BASIC_DATA:
|
||||||
Ins->NumUsrsWhoClaimToBelongToIns = 0;
|
Ins->NumUsrsWhoClaimToBelongToIns = 0;
|
||||||
Ins->NumCtrs = Ins->NumDegs = Ins->NumCrss = Ins->NumDpts = 0;
|
Ins->NumCtrs = Ins->NumDegs = Ins->NumCrss = Ins->NumDpts = 0;
|
||||||
Ins->NumUsrs = Ins->NumTchs = Ins->NumStds = 0;
|
Ins->NumUsrs = 0;
|
||||||
|
// Ins->NumUsrs = Ins->NumTchs = Ins->NumStds = 0;
|
||||||
break;
|
break;
|
||||||
case Ins_GET_EXTRA_DATA:
|
case Ins_GET_EXTRA_DATA:
|
||||||
/* Get number of users who claim to belong to this institution (row[7]) */
|
/* Get number of users who claim to belong to this institution (row[7]) */
|
||||||
|
@ -913,8 +918,8 @@ void Ins_GetListInstitutions (long CtyCod,Ins_GetExtraData_t GetExtraData)
|
||||||
|
|
||||||
/* Get number of users in courses */
|
/* Get number of users in courses */
|
||||||
Ins->NumUsrs = Usr_GetNumUsrsInCrssOfIns (Rol_UNKNOWN,Ins->InsCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
|
Ins->NumUsrs = Usr_GetNumUsrsInCrssOfIns (Rol_UNKNOWN,Ins->InsCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
|
||||||
Ins->NumTchs = Usr_GetNumUsrsInCrssOfIns (Rol_TEACHER,Ins->InsCod);
|
// Ins->NumTchs = Usr_GetNumUsrsInCrssOfIns (Rol_TEACHER,Ins->InsCod);
|
||||||
Ins->NumStds = Usr_GetNumUsrsInCrssOfIns (Rol_STUDENT,Ins->InsCod);
|
// Ins->NumStds = Usr_GetNumUsrsInCrssOfIns (Rol_STUDENT,Ins->InsCod);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -945,7 +950,8 @@ bool Ins_GetDataOfInstitutionByCod (struct Institution *Ins,
|
||||||
Ins->ShortName[0] =
|
Ins->ShortName[0] =
|
||||||
Ins->FullName[0] =
|
Ins->FullName[0] =
|
||||||
Ins->WWW[0] = '\0';
|
Ins->WWW[0] = '\0';
|
||||||
Ins->NumStds = Ins->NumTchs = Ins->NumUsrs =
|
// Ins->NumStds = Ins->NumTchs = Ins->NumUsrs =
|
||||||
|
Ins->NumUsrs =
|
||||||
Ins->NumCtrs = Ins->NumDpts = Ins->NumDegs = 0;
|
Ins->NumCtrs = Ins->NumDpts = Ins->NumDegs = 0;
|
||||||
|
|
||||||
/***** Check if institution code is correct *****/
|
/***** Check if institution code is correct *****/
|
||||||
|
@ -1000,8 +1006,8 @@ bool Ins_GetDataOfInstitutionByCod (struct Institution *Ins,
|
||||||
|
|
||||||
/* Get number of users in courses of this institution */
|
/* Get number of users in courses of this institution */
|
||||||
Ins->NumUsrs = Usr_GetNumUsrsInCrssOfIns (Rol_UNKNOWN,Ins->InsCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
|
Ins->NumUsrs = Usr_GetNumUsrsInCrssOfIns (Rol_UNKNOWN,Ins->InsCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs
|
||||||
Ins->NumStds = Usr_GetNumUsrsInCrssOfIns (Rol_STUDENT,Ins->InsCod);
|
// Ins->NumStds = Usr_GetNumUsrsInCrssOfIns (Rol_STUDENT,Ins->InsCod);
|
||||||
Ins->NumTchs = Usr_GetNumUsrsInCrssOfIns (Rol_TEACHER,Ins->InsCod);
|
// Ins->NumTchs = Usr_GetNumUsrsInCrssOfIns (Rol_TEACHER,Ins->InsCod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2186,7 +2192,7 @@ unsigned Ins_ListInssFound (const char *Query)
|
||||||
|
|
||||||
/* Number of institutions found */
|
/* Number of institutions found */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<th colspan=\"10\" class=\"CENTER_MIDDLE\">");
|
"<th colspan=\"9\" class=\"CENTER_MIDDLE\">");
|
||||||
if (NumInss == 1)
|
if (NumInss == 1)
|
||||||
fprintf (Gbl.F.Out,"1 %s",Txt_institution);
|
fprintf (Gbl.F.Out,"1 %s",Txt_institution);
|
||||||
else
|
else
|
||||||
|
|
|
@ -69,9 +69,9 @@ struct Institution
|
||||||
unsigned NumDegs;
|
unsigned NumDegs;
|
||||||
unsigned NumCrss;
|
unsigned NumCrss;
|
||||||
unsigned NumDpts;
|
unsigned NumDpts;
|
||||||
unsigned NumUsrs;
|
unsigned NumUsrs; // Number of users in courses of this institution
|
||||||
unsigned NumTchs;
|
// unsigned NumTchs; // Number of teachers in courses of this institution
|
||||||
unsigned NumStds;
|
// unsigned NumStds; // Number of students in courses of this institution
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
|
@ -3408,6 +3408,8 @@ unsigned Usr_GetNumUsrsInCrssOfCtr (Rol_Role_t Role,long CtrCod)
|
||||||
" AND courses.CrsCod=crs_usr.CrsCod",
|
" AND courses.CrsCod=crs_usr.CrsCod",
|
||||||
CtrCod);
|
CtrCod);
|
||||||
else
|
else
|
||||||
|
// This query is very slow.
|
||||||
|
// It's a bad idea to get number of teachers or students for a big list of centres
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
||||||
" FROM degrees,courses,crs_usr"
|
" FROM degrees,courses,crs_usr"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -3437,6 +3439,8 @@ unsigned Usr_GetNumUsrsInCrssOfIns (Rol_Role_t Role,long InsCod)
|
||||||
" AND courses.CrsCod=crs_usr.CrsCod",
|
" AND courses.CrsCod=crs_usr.CrsCod",
|
||||||
InsCod);
|
InsCod);
|
||||||
else
|
else
|
||||||
|
// This query is very slow.
|
||||||
|
// It's a bad idea to get number of teachers or students for a big list of institutions
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
||||||
" FROM centres,degrees,courses,crs_usr"
|
" FROM centres,degrees,courses,crs_usr"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -3468,6 +3472,8 @@ unsigned Usr_GetNumUsrsInCrssOfCty (Rol_Role_t Role,long CtyCod)
|
||||||
" AND courses.CrsCod=crs_usr.CrsCod",
|
" AND courses.CrsCod=crs_usr.CrsCod",
|
||||||
CtyCod);
|
CtyCod);
|
||||||
else
|
else
|
||||||
|
// This query is very slow.
|
||||||
|
// It's a bad idea to get number of teachers or students for a big list of countries
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
||||||
" FROM institutions,centres,degrees,courses,crs_usr"
|
" FROM institutions,centres,degrees,courses,crs_usr"
|
||||||
" WHERE institutions.CtyCod='%ld'"
|
" WHERE institutions.CtyCod='%ld'"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user