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: En OpenSWAD:
ps2pdf source.ps destination.pdf 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 CSS_FILE "swad19.47.css"
#define JS_FILE "swad19.39.js" #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: 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) // 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.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.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.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.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) Version 19.57: Nov 09, 2019 Code refactoring in HTML definition lists. (246156 lines)

View File

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

View File

@ -1925,6 +1925,27 @@ const char *Txt_Answers = // Answers of test
"Respostas"; "Respostas";
#endif #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 = const char *Txt_any_course =
#if L==1 // ca #if L==1 // ca
"qualsevol assignatura"; "qualsevol assignatura";
@ -1946,27 +1967,6 @@ const char *Txt_any_course =
"qualquer disciplina"; "qualquer disciplina";
#endif #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 = const char *Txt_Any_department =
#if L==1 // ca #if L==1 // ca
"Qualsevol departament"; "Qualsevol departament";
@ -1988,6 +1988,27 @@ const char *Txt_Any_department =
"Qualquer departamento"; "Qualquer departamento";
#endif #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 = const char *Txt_any_user =
#if L==1 // ca #if L==1 // ca
"qualsevol usuari"; "qualsevol usuari";
@ -39398,25 +39419,25 @@ const char *Txt_Show_office_hours =
"Mostrar hor&aacute;rios tutor"; "Mostrar hor&aacute;rios tutor";
#endif #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 #if L==1 // ca
"Mostrar %lu clics anteriores"; // Necessita traduccio "Mostrar %u clics anteriores"; // Necessita traduccio
#elif L==2 // de #elif L==2 // de
"Show previous %lu clicks"; // Need Übersetzung "Show previous %u clicks"; // Need Übersetzung
#elif L==3 // en #elif L==3 // en
"Show previous %lu clicks"; "Show previous %u clicks";
#elif L==4 // es #elif L==4 // es
"Mostrar %lu clics anteriores"; "Mostrar %u clics anteriores";
#elif L==5 // fr #elif L==5 // fr
"Show previous %lu clicks"; // Besoin de traduction "Show previous %u clicks"; // Besoin de traduction
#elif L==6 // gn #elif L==6 // gn
"Mostrar %lu clics anteriores"; // Okoteve traducción "Mostrar %u clics anteriores"; // Okoteve traducción
#elif L==7 // it #elif L==7 // it
"Mostra %lu scatti precedenti"; "Mostra %u scatti precedenti";
#elif L==8 // pl #elif L==8 // pl
"Show previous %lu clicks"; // Potrzebujesz tlumaczenie "Show previous %u clicks"; // Potrzebujesz tlumaczenie
#elif L==9 // pt #elif L==9 // pt
"Mostrar %lu cliques anteriores"; "Mostrar %u cliques anteriores";
#endif #endif
const char *Txt_Show_questions = 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] = const char *Txt_TABS_TXT[Tab_NUM_TABS] =
{ {
// TabUnk // TabUnk
NULL ""
, ,
// TabStr // TabStr
#if L==1 // ca #if L==1 // ca