Version19.60.3

This commit is contained in:
Antonio Cañas Vargas 2019-11-09 23:10:12 +01:00
parent 00264433a5
commit 6485191365
5 changed files with 105 additions and 82 deletions

View File

@ -487,7 +487,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.60.2 (2019-11-09)"
#define Log_PLATFORM_VERSION "SWAD 19.60.3 (2019-11-09)"
#define CSS_FILE "swad19.47.css"
#define JS_FILE "swad19.39.js"
/*
@ -495,9 +495,10 @@ ps2pdf source.ps destination.pdf
// TODO: Impedir la creación y edición de proyectos si no son editables.
// TODO: Importante: filtrar proyectos por usuarios (igual que en trabajos o en asistencia)
Version 19.60.3: Nov 09, 2019 Code refactoring in HTML select options. (246311 lines)
Version 19.60.2: Nov 09, 2019 Code refactoring in HTML break lines. (246290 lines)
Version 19.60.1: Nov 09, 2019 Code refactoring in HTML break lines. (246281 lines)
Version 19.60: Nov 09, 2019 Code refactoring in HTML options. (246203 lines)
Version 19.60: Nov 09, 2019 Code refactoring in HTML select options. (246203 lines)
Version 19.59: Nov 09, 2019 Code refactoring in HTML params. (246187 lines)
Version 19.58: Nov 09, 2019 Code refactoring in HTML definition lists. (246169 lines)
Version 19.57: Nov 09, 2019 Code refactoring in HTML definition lists. (246156 lines)

View File

@ -349,7 +349,7 @@ void Gbl_InitializeGlobals (void)
Gbl.Stat.Role = Sta_ROLE_DEFAULT;
Gbl.Stat.NumAction = Sta_NUM_ACTION_DEFAULT;
Gbl.Stat.RowsPerPage = Sta_DEF_ROWS_PER_PAGE;
Gbl.Figures.FigureType = Fig_FIGURE_TYPE_DEF;
Gbl.Figures.FigureType = Fig_FIGURE_TYPE_DEF;
Gbl.Scope.Current = Hie_CRS;

View File

@ -736,7 +736,7 @@ struct Globals
Act_Action_t NumAction;
unsigned long FirstRow;
unsigned long LastRow;
unsigned long RowsPerPage;
unsigned RowsPerPage;
long DegTypCod;
long DptCod;
char StrIndicatorsSelected[Ind_MAX_SIZE_INDICATORS_SELECTED + 1];

View File

@ -297,7 +297,7 @@ void Sta_AskShowCrsHits (void)
extern const char *Txt_results_per_page;
extern const char *Txt_Show_hits;
extern const char *Txt_No_teachers_or_students_found;
static unsigned long RowsPerPage[] =
static unsigned RowsPerPage[] =
{
Sta_MIN_ROWS_PER_PAGE * 1,
Sta_MIN_ROWS_PER_PAGE * 2,
@ -315,7 +315,8 @@ void Sta_AskShowCrsHits (void)
#define NUM_OPTIONS_ROWS_PER_PAGE (sizeof (RowsPerPage) / sizeof (RowsPerPage[0]))
unsigned NumTotalUsrs;
Sta_ClicksGroupedBy_t ClicksGroupedBy;
unsigned long i;
unsigned ClicksGroupedByUnsigned;
size_t i;
/***** Contextual menu *****/
Mnu_ContextMenuBegin ();
@ -425,11 +426,10 @@ void Sta_AskShowCrsHits (void)
ClicksGroupedBy <= Sta_CLICKS_CRS_PER_ACTION;
ClicksGroupedBy++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",
(unsigned) ClicksGroupedBy);
if (ClicksGroupedBy == Gbl.Stat.ClicksGroupedBy)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s",Txt_STAT_CLICKS_GROUPED_BY[ClicksGroupedBy]);
ClicksGroupedByUnsigned = (unsigned) ClicksGroupedBy;
HTM_OPTION (HTM_Type_UNSIGNED,&ClicksGroupedByUnsigned,
ClicksGroupedBy == Gbl.Stat.ClicksGroupedBy,false,
"%s",Txt_STAT_CLICKS_GROUPED_BY[ClicksGroupedBy]);
}
HTM_SELECT_End ();
HTM_LABEL_End ();
@ -460,12 +460,9 @@ void Sta_AskShowCrsHits (void)
for (i = 0;
i < NUM_OPTIONS_ROWS_PER_PAGE;
i++)
{
fprintf (Gbl.F.Out,"<option");
if (RowsPerPage[i] == Gbl.Stat.RowsPerPage)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%lu",RowsPerPage[i]);
}
HTM_OPTION (HTM_Type_UNSIGNED,&RowsPerPage[i],
RowsPerPage[i] == Gbl.Stat.RowsPerPage,false,
"%u",RowsPerPage[i]);
HTM_SELECT_End ();
fprintf (Gbl.F.Out,")");
HTM_LABEL_End ();
@ -519,7 +516,9 @@ void Sta_AskShowGblHits (void)
extern const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY];
extern const char *Txt_Show_hits;
Sta_Role_t RoleStat;
unsigned RoleStatUnsigned;
Sta_ClicksGroupedBy_t ClicksGroupedBy;
unsigned ClicksGroupedByUnsigned;
/***** Contextual menu *****/
Mnu_ContextMenuBegin ();
@ -553,10 +552,10 @@ void Sta_AskShowGblHits (void)
RoleStat < Sta_NUM_ROLES_STAT;
RoleStat++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) RoleStat);
if (RoleStat == Gbl.Stat.Role)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s",Txt_ROLE_STATS[RoleStat]);
RoleStatUnsigned = (unsigned) RoleStat;
HTM_OPTION (HTM_Type_UNSIGNED,&RoleStatUnsigned,
RoleStat == Gbl.Stat.Role,false,
"%s",Txt_ROLE_STATS[RoleStat]);
}
HTM_SELECT_End ();
HTM_TD_End ();
@ -615,11 +614,10 @@ void Sta_AskShowGblHits (void)
ClicksGroupedBy <= Sta_CLICKS_GBL_PER_COURSE;
ClicksGroupedBy++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",
(unsigned) ClicksGroupedBy);
if (ClicksGroupedBy == Gbl.Stat.ClicksGroupedBy)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s",Txt_STAT_CLICKS_GROUPED_BY[ClicksGroupedBy]);
ClicksGroupedByUnsigned = (unsigned) ClicksGroupedBy;
HTM_OPTION (HTM_Type_UNSIGNED,&ClicksGroupedByUnsigned,
ClicksGroupedBy == Gbl.Stat.ClicksGroupedBy,false,
"%s",Txt_STAT_CLICKS_GROUPED_BY[ClicksGroupedBy]);
}
HTM_SELECT_End ();
HTM_LABEL_End ();
@ -684,6 +682,7 @@ static void Sta_WriteSelectorCountType (void)
{
extern const char *Txt_STAT_TYPE_COUNT_SMALL[Sta_NUM_COUNT_TYPES];
Sta_CountType_t StatCountType;
unsigned StatCountTypeUnsigned;
/**** Count type *****/
HTM_SELECT_Begin (false,
@ -692,10 +691,10 @@ static void Sta_WriteSelectorCountType (void)
StatCountType < Sta_NUM_COUNT_TYPES;
StatCountType++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) StatCountType);
if (StatCountType == Gbl.Stat.CountType)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s",Txt_STAT_TYPE_COUNT_SMALL[StatCountType]);
StatCountTypeUnsigned = (unsigned) StatCountType;
HTM_OPTION (HTM_Type_UNSIGNED,&StatCountTypeUnsigned,
StatCountType == Gbl.Stat.CountType,false,
"%s",Txt_STAT_TYPE_COUNT_SMALL[StatCountType]);
}
HTM_SELECT_End ();
}
@ -708,8 +707,10 @@ static void Sta_WriteSelectorAction (void)
{
extern const char *The_ClassFormInBox[The_NUM_THEMES];
extern const char *Txt_Action;
extern const char *Txt_Any_action;
extern const char *Txt_TABS_TXT[Tab_NUM_TABS];
Act_Action_t Action;
unsigned ActionUnsigned;
Tab_Tab_t Tab;
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1];
@ -724,21 +725,19 @@ static void Sta_WriteSelectorAction (void)
HTM_TD_Begin ("colspan=\"2\" class=\"LM\"");
HTM_SELECT_Begin (false,
"id=\"StatAct\" name=\"StatAct\" class=\"STAT_SEL\"");
for (Action = (Act_Action_t) 0;
HTM_OPTION (HTM_Type_STRING,"0",Gbl.Stat.NumAction == 0,false,
"%s",Txt_Any_action);
for (Action = (Act_Action_t) 1;
Action < Act_NUM_ACTIONS;
Action++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Action);
if (Action == Gbl.Stat.NumAction)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">");
if (Action)
fprintf (Gbl.F.Out,"%u: ",(unsigned) Action);
Tab = Act_GetTab (Act_GetSuperAction (Action));
if (Txt_TABS_TXT[Tab])
fprintf (Gbl.F.Out,"%s &gt; ",Txt_TABS_TXT[Tab]);
fprintf (Gbl.F.Out,"%s",
Act_GetActionTextFromDB (Act_GetActCod (Action),ActTxt));
Act_GetActionTextFromDB (Act_GetActCod (Action),ActTxt);
ActionUnsigned = (unsigned) Action;
HTM_OPTION (HTM_Type_UNSIGNED,&ActionUnsigned,
Action == Gbl.Stat.NumAction,false,
"%u: %s &gt; %s",(unsigned) Action,Txt_TABS_TXT[Tab],ActTxt);
}
HTM_SELECT_End ();
HTM_TD_End ();
@ -901,10 +900,11 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
0);
/****** Get the number of rows per page ******/
Gbl.Stat.RowsPerPage = Par_GetParToUnsignedLong ("RowsPage",
Sta_MIN_ROWS_PER_PAGE,
Sta_MAX_ROWS_PER_PAGE,
Sta_DEF_ROWS_PER_PAGE);
Gbl.Stat.RowsPerPage =
(unsigned) Par_GetParToUnsignedLong ("RowsPage",
Sta_MIN_ROWS_PER_PAGE,
Sta_MAX_ROWS_PER_PAGE,
Sta_DEF_ROWS_PER_PAGE);
}
/****** Get lists of selected users ******/
@ -1609,7 +1609,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql
Par_PutHiddenParamUnsigned (NULL,"StatAct" ,(unsigned) Gbl.Stat.NumAction);
Par_PutHiddenParamLong (NULL,"FirstRow",FirstRow - Gbl.Stat.RowsPerPage);
Par_PutHiddenParamLong (NULL,"LastRow" ,FirstRow - 1);
Par_PutHiddenParamLong (NULL,"RowsPage",Gbl.Stat.RowsPerPage);
Par_PutHiddenParamUnsigned (NULL,"RowsPage",Gbl.Stat.RowsPerPage);
Usr_PutHiddenParSelectedUsrsCods ();
}
HTM_TD_Begin ("class=\"LM\"");
@ -2041,6 +2041,7 @@ static void Sta_ShowDistrAccessesPerDayAndHour (unsigned long NumRows,MYSQL_RES
extern const char *Txt_STAT_TYPE_COUNT_CAPS[Sta_NUM_COUNT_TYPES];
extern const char *Txt_DAYS_SMALL[7];
Sta_ColorType_t ColorType;
unsigned ColorTypeUnsigned;
Sta_ColorType_t SelectedColorType;
unsigned long NumRow;
struct Date PreviousReadDate;
@ -2087,10 +2088,10 @@ static void Sta_ShowDistrAccessesPerDayAndHour (unsigned long NumRows,MYSQL_RES
ColorType < Sta_NUM_COLOR_TYPES;
ColorType++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) ColorType);
if (ColorType == SelectedColorType)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s",Txt_STAT_COLOR_TYPES[ColorType]);
ColorTypeUnsigned = (unsigned) ColorType;
HTM_OPTION (HTM_Type_UNSIGNED,&ColorTypeUnsigned,
ColorType == SelectedColorType,false,
"%s",Txt_STAT_COLOR_TYPES[ColorType]);
}
HTM_SELECT_End ();
HTM_LABEL_End ();

View File

@ -1925,6 +1925,27 @@ const char *Txt_Answers = // Answers of test
"Respostas";
#endif
const char *Txt_Any_action =
#if L==1 // ca
"Qualsevol acci&oacute;";
#elif L==2 // de
"Alle Handlung";
#elif L==3 // en
"Any action";
#elif L==4 // es
"Cualquier acci&oacute;n";
#elif L==5 // fr
"Toute action";
#elif L==6 // gn
"Cualquier acci&oacute;n"; // Okoteve traducción
#elif L==7 // it
"Qualsiasi azione";
#elif L==8 // pl
"Wszystkie dzia&lstrok;ania";
#elif L==9 // pt
"Qualquer a&ccedil;&atilde;o";
#endif
const char *Txt_any_course =
#if L==1 // ca
"qualsevol assignatura";
@ -1946,27 +1967,6 @@ const char *Txt_any_course =
"qualquer disciplina";
#endif
const char *Txt_Any_type_of_degree =
#if L==1 // ca
"Qualsevol tipus de titulaci&oacute;";
#elif L==2 // de
"Alle Abschlussart";
#elif L==3 // en
"grau";
#elif L==4 // es
"Cualquier tipo de titulaci&oacute;n";
#elif L==5 // fr
"Tout type d'&eacute;tude";
#elif L==6 // gn
"Cualquier tipo de titulaci&oacute;n"; // Okoteve traducción
#elif L==7 // it
"Qualsiasi tipo di laurea";
#elif L==8 // pl
"Dowolny rodzaj stopnia";
#elif L==9 // pt
"Qualquer tipo de grau";
#endif
const char *Txt_Any_department =
#if L==1 // ca
"Qualsevol departament";
@ -1988,6 +1988,27 @@ const char *Txt_Any_department =
"Qualquer departamento";
#endif
const char *Txt_Any_type_of_degree =
#if L==1 // ca
"Qualsevol tipus de titulaci&oacute;";
#elif L==2 // de
"Alle Abschlussart";
#elif L==3 // en
"grau";
#elif L==4 // es
"Cualquier tipo de titulaci&oacute;n";
#elif L==5 // fr
"Tout type d'&eacute;tude";
#elif L==6 // gn
"Cualquier tipo de titulaci&oacute;n"; // Okoteve traducción
#elif L==7 // it
"Qualsiasi tipo di laurea";
#elif L==8 // pl
"Dowolny rodzaj stopnia";
#elif L==9 // pt
"Qualquer tipo de grau";
#endif
const char *Txt_any_user =
#if L==1 // ca
"qualsevol usuari";
@ -39398,25 +39419,25 @@ const char *Txt_Show_office_hours =
"Mostrar hor&aacute;rios tutor";
#endif
const char *Txt_Show_previous_X_clicks = // Warning: it is very important to include %lu in the following sentences
const char *Txt_Show_previous_X_clicks = // Warning: it is very important to include %u in the following sentences
#if L==1 // ca
"Mostrar %lu clics anteriores"; // Necessita traduccio
"Mostrar %u clics anteriores"; // Necessita traduccio
#elif L==2 // de
"Show previous %lu clicks"; // Need Übersetzung
"Show previous %u clicks"; // Need Übersetzung
#elif L==3 // en
"Show previous %lu clicks";
"Show previous %u clicks";
#elif L==4 // es
"Mostrar %lu clics anteriores";
"Mostrar %u clics anteriores";
#elif L==5 // fr
"Show previous %lu clicks"; // Besoin de traduction
"Show previous %u clicks"; // Besoin de traduction
#elif L==6 // gn
"Mostrar %lu clics anteriores"; // Okoteve traducción
"Mostrar %u clics anteriores"; // Okoteve traducción
#elif L==7 // it
"Mostra %lu scatti precedenti";
"Mostra %u scatti precedenti";
#elif L==8 // pl
"Show previous %lu clicks"; // Potrzebujesz tlumaczenie
"Show previous %u clicks"; // Potrzebujesz tlumaczenie
#elif L==9 // pt
"Mostrar %lu cliques anteriores";
"Mostrar %u cliques anteriores";
#endif
const char *Txt_Show_questions =
@ -42179,7 +42200,7 @@ const char *Txt_Table_not_found_in_the_file_of_marks =
const char *Txt_TABS_TXT[Tab_NUM_TABS] =
{
// TabUnk
NULL
""
,
// TabStr
#if L==1 // ca