Version 15.220

This commit is contained in:
Antonio Cañas Vargas 2016-06-08 13:19:17 +02:00
parent 8bb9d7aeec
commit faa0d1740f
2 changed files with 59 additions and 53 deletions

View File

@ -125,19 +125,23 @@
// TODO: Messages in msg_content_deleted older than a certain time should be deleted to ensure the protection of personal data // TODO: Messages in msg_content_deleted older than a certain time should be deleted to ensure the protection of personal data
// TODO: Request confirmation to remove user's photo // TODO: Request confirmation to remove user's photo
// TODO: FIX BUG: A teacher uploads a document in course documents zone, then he/she unregister from course, then he/she search for his/her documents, a document is shown in results but he/she can not view it // TODO: FIX BUG: A teacher uploads a document in course documents zone, then he/she unregister from course, then he/she search for his/her documents, a document is shown in results but he/she can not view it
// TODO: Highlight row with number of indicators selected in blue background, as part of the form, instead of current field to select number of indicators // TODO: Do not show users without name in users to follow
// TODO: Modify WS function getUsers changing: userRole to indicate all users, and a new parameter filter (search string (name, @nickname, mail)) to restring number of users
// TODO: Add a new WS function to count the nunmber of users to return in call to function getUsers
/*****************************************************************************/ /*****************************************************************************/
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.219.1 (2016-06-05)" #define Log_PLATFORM_VERSION "SWAD 15.220 (2016-06-08)"
#define CSS_FILE "swad15.218.css" #define CSS_FILE "swad15.218.css"
#define JS_FILE "swad15.216.js" #define JS_FILE "swad15.216.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 15.220: Jun 08, 2016 Number of indicators now appears inside form. (202029 lines)
Version 15.219.1: Jun 05, 2016 Highlighted row with number of indicators selected. (202023 lines) Version 15.219.1: Jun 05, 2016 Highlighted row with number of indicators selected. (202023 lines)
Version 15.219: Jun 04, 2016 Changes in listing of indicators of courses. (202001 lines) Version 15.219: Jun 04, 2016 Changes in listing of indicators of courses. (202001 lines)
Version 15.218.5: Jun 04, 2016 Fix bug in social notes, reported by Raymon Moreno Colina. (201940 lines) Version 15.218.5: Jun 04, 2016 Fix bug in social notes, reported by Raymon Moreno Colina. (201940 lines)

View File

@ -68,7 +68,7 @@ static void Ind_PutButtonToConfirmIWantToSeeBigList (unsigned NumCrss);
static void Ind_GetNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS], static void Ind_GetNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS],
unsigned NumCrss,MYSQL_RES *mysql_res); unsigned NumCrss,MYSQL_RES *mysql_res);
static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS], static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS],
unsigned NumCrss); unsigned NumCrss,bool PutForm);
static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t IndicatorsLayout, static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t IndicatorsLayout,
unsigned NumCrss,MYSQL_RES *mysql_res); unsigned NumCrss,MYSQL_RES *mysql_res);
static unsigned long Ind_GetNumFilesOfCrsFileZoneFromDB (Brw_FileBrowser_t FileBrowser,long CrsCod); static unsigned long Ind_GetNumFilesOfCrsFileZoneFromDB (Brw_FileBrowser_t FileBrowser,long CrsCod);
@ -86,12 +86,10 @@ void Ind_ReqIndicatorsCourses (void)
extern const char *Txt_only_if_the_scope_is_X; extern const char *Txt_only_if_the_scope_is_X;
extern const char *Txt_Department; extern const char *Txt_Department;
extern const char *Txt_No_of_indicators; extern const char *Txt_No_of_indicators;
extern const char *Txt_Any_number;
extern const char *Txt_Update_indicators; extern const char *Txt_Update_indicators;
extern const char *Txt_Indicators_of_courses; extern const char *Txt_Indicators_of_courses;
extern const char *Txt_Show_more_details; extern const char *Txt_Show_more_details;
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
unsigned Ind;
unsigned NumCrss; unsigned NumCrss;
unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS]; unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS];
unsigned NumCrssToList; unsigned NumCrssToList;
@ -149,33 +147,32 @@ void Ind_ReqIndicatorsCourses (void)
/* Show only courses with a number of indicators */ /* Show only courses with a number of indicators */
Gbl.Stat.NumIndicators = Ind_GetParamNumIndicators (); Gbl.Stat.NumIndicators = Ind_GetParamNumIndicators ();
/***** Get courses from database *****/
/* The result will contain courses with any number of indicators
If Gbl.Stat.NumIndicators < 0 ==> all courses in result will be listed
If Gbl.Stat.NumIndicators >= 0 ==> only those courses in result
with Gbl.Stat.NumIndicators set to yes
will be listed */
NumCrss = Ind_GetTableOfCourses (&mysql_res);
/***** Get vector with numbers of courses with 0, 1, 2... indicators set to yes *****/
Ind_GetNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,mysql_res);
/***** Show table with numbers of courses with 0, 1, 2... indicators set to yes *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"RIGHT_MIDDLE\">" "<td class=\"RIGHT_TOP\">"
"<label class=\"%s\">%s:</label>" "<label class=\"%s\">%s:</label>"
"</td>" "</td>"
"<td class=\"LEFT_MIDDLE\">" "<td class=\"LEFT_TOP\">",
"<select name=\"Indicators\">",
The_ClassForm[Gbl.Prefs.Theme],Txt_No_of_indicators); The_ClassForm[Gbl.Prefs.Theme],Txt_No_of_indicators);
fprintf (Gbl.F.Out,"<option value=\"-1\""); Ind_ShowNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,true);
if (Gbl.Stat.NumIndicators < 0) fprintf (Gbl.F.Out,"</td>"
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s</option>",Txt_Any_number);
for (Ind = 0;
Ind <= Ind_NUM_INDICATORS;
Ind++)
{
fprintf (Gbl.F.Out,"<option");
if ((long) Ind == Gbl.Stat.NumIndicators)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%u</option>",Ind);
}
fprintf (Gbl.F.Out,"</select>"
"</td>"
"</tr>"); "</tr>");
/* Send button */ /* Send button */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\" class=\"CENTER_MIDDLE\">"); "<td colspan=\"2\" class=\"CENTER_MIDDLE\" style=\"padding:10px 0\">");
Act_LinkFormSubmitAnimated (Txt_Update_indicators,The_ClassFormBold[Gbl.Prefs.Theme]); Act_LinkFormSubmitAnimated (Txt_Update_indicators,The_ClassFormBold[Gbl.Prefs.Theme]);
Lay_PutCalculateIconWithText (Txt_Update_indicators,Txt_Update_indicators); Lay_PutCalculateIconWithText (Txt_Update_indicators,Txt_Update_indicators);
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
@ -185,28 +182,13 @@ void Ind_ReqIndicatorsCourses (void)
/* End form */ /* End form */
Act_FormEnd (); Act_FormEnd ();
/***** Get courses from database *****/ /***** Show the stats of courses *****/
// The result will contain courses with any number of indicators
// If Gbl.Stat.NumIndicators < 0 ==> all courses in result will be listed
// If Gbl.Stat.NumIndicators >= 0 ==> only those courses in result
// with Gbl.Stat.NumIndicators set to yes
// will be listed
NumCrss = Ind_GetTableOfCourses (&mysql_res);
/***** Get vector with numbers of courses with 0, 1, 2... indicators set to yes *****/
Ind_GetNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,mysql_res);
/***** Show table with numbers of courses with 0, 1, 2... indicators set to yes *****/
Ind_ShowNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss);
if (Gbl.Stat.NumIndicators < 0) // -1 means any number of indicators if (Gbl.Stat.NumIndicators < 0) // -1 means any number of indicators
NumCrssToList = NumCrss; NumCrssToList = NumCrss;
else else
NumCrssToList = NumCrssWithIndicatorYes[(unsigned) Gbl.Stat.NumIndicators]; NumCrssToList = NumCrssWithIndicatorYes[(unsigned) Gbl.Stat.NumIndicators];
if (Ind_GetIfShowBigList (NumCrssToList)) if (Ind_GetIfShowBigList (NumCrssToList))
{ {
/***** Show the stats of courses *****/
/* Show table */ /* Show table */
Ind_ShowTableOfCoursesWithIndicators (Ind_INDICATORS_BRIEF,NumCrss,mysql_res); Ind_ShowTableOfCoursesWithIndicators (Ind_INDICATORS_BRIEF,NumCrss,mysql_res);
@ -264,7 +246,7 @@ void Ind_ShowIndicatorsCourses (void)
Ind_GetNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,mysql_res); Ind_GetNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,mysql_res);
/***** Show table with numbers of courses with 0, 1, 2... indicators set to yes *****/ /***** Show table with numbers of courses with 0, 1, 2... indicators set to yes *****/
Ind_ShowNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss); Ind_ShowNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,false);
/***** Show the stats of courses *****/ /***** Show the stats of courses *****/
Ind_ShowTableOfCoursesWithIndicators (Ind_INDICATORS_FULL,NumCrss,mysql_res); Ind_ShowTableOfCoursesWithIndicators (Ind_INDICATORS_FULL,NumCrss,mysql_res);
@ -560,11 +542,11 @@ static void Ind_GetNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1+
/*****************************************************************************/ /*****************************************************************************/
static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS], static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS],
unsigned NumCrss) unsigned NumCrss,bool PutForm)
{ {
extern const char *Txt_No_of_indicators; extern const char *Txt_No_of_indicators;
extern const char *Txt_Courses; extern const char *Txt_Courses;
extern const char *Txt_Total; extern const char *Txt_Any_number;
unsigned Ind; unsigned Ind;
const char *Class; const char *Class;
const char *ClassNormal = "DAT RIGHT_MIDDLE"; const char *ClassNormal = "DAT RIGHT_MIDDLE";
@ -573,10 +555,11 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1
const char *ClassTotalHighlight = "DAT_N_LINE_TOP RIGHT_MIDDLE LIGHT_BLUE"; const char *ClassTotalHighlight = "DAT_N_LINE_TOP RIGHT_MIDDLE LIGHT_BLUE";
/***** Write number of courses with each number of indicators valid *****/ /***** Write number of courses with each number of indicators valid *****/
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\"" fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\">"
" style=\"padding:10px; margin:0 auto;\">" "<tr>");
"<tr>" if (PutForm)
"<th class=\"RIGHT_MIDDLE\">" fprintf (Gbl.F.Out,"<th></th>");
fprintf (Gbl.F.Out,"<th class=\"RIGHT_MIDDLE\">"
"%s" "%s"
"</th>" "</th>"
"<th colspan=\"2\" class=\"RIGHT_MIDDLE\">" "<th colspan=\"2\" class=\"RIGHT_MIDDLE\">"
@ -591,8 +574,18 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1
{ {
Class = (Ind == Gbl.Stat.NumIndicators) ? ClassHighlight : Class = (Ind == Gbl.Stat.NumIndicators) ? ClassHighlight :
ClassNormal; ClassNormal;
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>");
"<td class=\"%s\">" if (PutForm)
{
fprintf (Gbl.F.Out,"<td class=\"%s\">"
"<input type=\"radio\" name=\"Indicators\" value=\"%u\"",
Class,Ind);
if ((long) Ind == Gbl.Stat.NumIndicators)
fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," />"
"</td>");
}
fprintf (Gbl.F.Out,"<td class=\"%s\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s\">" "<td class=\"%s\">"
@ -614,8 +607,18 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1
/***** Write total of courses *****/ /***** Write total of courses *****/
Class = (Gbl.Stat.NumIndicators < 0) ? ClassTotalHighlight : Class = (Gbl.Stat.NumIndicators < 0) ? ClassTotalHighlight :
ClassTotalNormal; ClassTotalNormal;
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>");
"<td class=\"%s\">" if (PutForm)
{
fprintf (Gbl.F.Out,"<td class=\"%s\">"
"<input type=\"radio\" name=\"Indicators\" value=\"-1\"",
Class);
if (Gbl.Stat.NumIndicators < 0)
fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," />"
"</td>");
}
fprintf (Gbl.F.Out,"<td class=\"%s\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s\">" "<td class=\"%s\">"
@ -627,7 +630,7 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1
"</tr>" "</tr>"
"</table>", "</table>",
Class, Class,
Txt_Total, Txt_Any_number,
Class, Class,
NumCrss, NumCrss,
Class, Class,
@ -669,7 +672,6 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat
extern const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_INFO_SOURCES]; extern const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_INFO_SOURCES];
extern const char *Txt_No_of_indicators; extern const char *Txt_No_of_indicators;
extern const char *Txt_Courses; extern const char *Txt_Courses;
extern const char *Txt_Total;
MYSQL_ROW row; MYSQL_ROW row;
unsigned NumCrs; unsigned NumCrs;
long CrsCod; long CrsCod;