Version19.54.7

This commit is contained in:
Antonio Cañas Vargas 2019-11-06 21:49:20 +01:00
parent 4731e69f3f
commit 5ff423a22c
4 changed files with 63 additions and 84 deletions

View File

@ -490,7 +490,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.54.6 (2019-11-06)"
#define Log_PLATFORM_VERSION "SWAD 19.54.7 (2019-11-06)"
#define CSS_FILE "swad19.47.css"
#define JS_FILE "swad19.39.js"
/*
@ -498,6 +498,7 @@ 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.54.7: Nov 05, 2019 Code refactoring in HTML select options. (245923 lines)
Version 19.54.6: Nov 05, 2019 Code refactoring in HTML select options. (245941 lines)
Version 19.54.5: Nov 05, 2019 Code refactoring in HTML select options. (245985 lines)
Version 19.54.4: Nov 05, 2019 Code refactoring in HTML select options. (246023 lines)

View File

@ -1124,20 +1124,13 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
for (Year = 0;
Year <= Deg_MAX_YEARS_PER_DEGREE;
Year++)
{
fprintf (Gbl.F.Out,"<option");
if (Gbl.ExamAnns.ExaDat.Year == Year)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out," value=\"%u\">"
"%s"
"</option>",
Year,Txt_YEAR_OF_DEGREE[Year]);
}
HTM_OPTION (HTM_Type_UNSIGNED,&Year,
Gbl.ExamAnns.ExaDat.Year == Year,false,
"%s",Txt_YEAR_OF_DEGREE[Year]);
HTM_SELECT_End ();
}
else
fprintf (Gbl.F.Out,"%s",
Txt_YEAR_OF_DEGREE[Gbl.ExamAnns.ExaDat.Year]);
fprintf (Gbl.F.Out,"%s",Txt_YEAR_OF_DEGREE[Gbl.ExamAnns.ExaDat.Year]);
HTM_TD_End ();
HTM_TR_End ();
@ -1200,20 +1193,15 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
{
HTM_SELECT_Begin (false,
"name=\"ExamHour\"");
fprintf (Gbl.F.Out,"<option value=\"0\"");
if (Gbl.ExamAnns.ExaDat.StartTime.Hour == 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">-</option>");
HTM_OPTION (HTM_Type_STRING,"0",
Gbl.ExamAnns.ExaDat.StartTime.Hour == 0,false,
"-");
for (Hour = 7;
Hour <= 22;
Hour++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",Hour);
if (Gbl.ExamAnns.ExaDat.StartTime.Hour == Hour)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%02u %s</option>",
Hour,Txt_hours_ABBREVIATION);
}
HTM_OPTION (HTM_Type_UNSIGNED,&Hour,
Gbl.ExamAnns.ExaDat.StartTime.Hour == Hour,false,
"%02u %s",Hour,Txt_hours_ABBREVIATION);
HTM_SELECT_End ();
HTM_SELECT_Begin (false,
@ -1221,12 +1209,9 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
for (Minute = 0;
Minute <= 59;
Minute++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",Minute);
if (Gbl.ExamAnns.ExaDat.StartTime.Minute == Minute)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%02u &#39;</option>",Minute);
}
HTM_OPTION (HTM_Type_UNSIGNED,&Minute,
Gbl.ExamAnns.ExaDat.StartTime.Minute == Minute,false,
"%02u &#39;",Minute);
HTM_SELECT_End ();
}
else if (Gbl.ExamAnns.ExaDat.StartTime.Hour)
@ -1252,13 +1237,9 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
for (Hour = 0;
Hour <= 8;
Hour++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",Hour);
if (Gbl.ExamAnns.ExaDat.Duration.Hour == Hour)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%02u %s</option>",
Hour,Txt_hours_ABBREVIATION);
}
HTM_OPTION (HTM_Type_UNSIGNED,&Hour,
Gbl.ExamAnns.ExaDat.Duration.Hour == Hour,false,
"%02u %s",Hour,Txt_hours_ABBREVIATION);
HTM_SELECT_End ();
HTM_SELECT_Begin (false,
@ -1266,12 +1247,9 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
for (Minute = 0;
Minute <= 59;
Minute++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",Minute);
if (Gbl.ExamAnns.ExaDat.Duration.Minute == Minute)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%02u &#39;</option>",Minute);
}
HTM_OPTION (HTM_Type_UNSIGNED,&Minute,
Gbl.ExamAnns.ExaDat.Duration.Minute == Minute,false,
"%02u &#39;",Minute);
HTM_SELECT_End ();
}
else if (Gbl.ExamAnns.ExaDat.Duration.Hour ||

View File

@ -9370,6 +9370,7 @@ void Brw_ShowFileMetadata (void)
bool ShowPhoto;
char PhotoURL[PATH_MAX + 1];
Brw_License_t License;
unsigned LicenseUnsigned;
/***** Get parameters related to file browser *****/
Brw_GetParAndInitFileBrowser ();
@ -9577,17 +9578,12 @@ void Brw_ShowFileMetadata (void)
{
HTM_SELECT_Begin (false,
"id=\"PublicFile\" name=\"PublicFile\"");
fprintf (Gbl.F.Out,"<option value=\"N\"");
if (!FileMetadata.IsPublic)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s</option>",Txt_Private_available_to_certain_users_identified);
fprintf (Gbl.F.Out,"<option value=\"Y\"");
if (FileMetadata.IsPublic)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s</option>",Txt_Public_open_educational_resource_OER_for_everyone);
HTM_OPTION (HTM_Type_STRING,"N",
!FileMetadata.IsPublic,false,
"%s",Txt_Private_available_to_certain_users_identified);
HTM_OPTION (HTM_Type_STRING,"Y",
FileMetadata.IsPublic,false,
"%s",Txt_Public_open_educational_resource_OER_for_everyone);
HTM_SELECT_End ();
}
else // I can not edit file properties
@ -9617,10 +9613,10 @@ void Brw_ShowFileMetadata (void)
License < Brw_NUM_LICENSES;
License++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) License);
if (License == FileMetadata.License)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s</option>",Txt_LICENSES[License]);
LicenseUnsigned = (unsigned) License;
HTM_OPTION (HTM_Type_UNSIGNED,&LicenseUnsigned,
License == FileMetadata.License,false,
"%s",Txt_LICENSES[License]);
}
HTM_SELECT_End ();
}
@ -12140,12 +12136,9 @@ void Brw_AskRemoveOldFiles (void)
for (Months = Brw_MIN_MONTHS_TO_REMOVE_OLD_FILES;
Months <= Brw_MAX_MONTHS_IN_BRIEFCASE;
Months++)
{
fprintf (Gbl.F.Out,"<option");
if (Months == Brw_DEF_MONTHS_TO_REMOVE_OLD_FILES)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%u</option>",Months);
}
HTM_OPTION (HTM_Type_UNSIGNED,&Months,
Months == Brw_DEF_MONTHS_TO_REMOVE_OLD_FILES,false,
"%u",Months);
HTM_SELECT_End ();
fprintf (Gbl.F.Out,"&nbsp;");
fprintf (Gbl.F.Out,Txt_Remove_files_older_than_PART_2_OF_2,

View File

@ -1783,6 +1783,7 @@ static void Pho_PutSelectorForTypeOfAvg (void)
extern const char *Txt_Average_type;
extern const char *Txt_AVERAGE_PHOTO_TYPES[Pho_NUM_AVERAGE_PHOTO_TYPES];
Pho_AvgPhotoTypeOfAverage_t TypeOfAvg;
unsigned TypeOfAvgUnsigned;
HTM_TR_Begin (NULL);
@ -1803,10 +1804,10 @@ static void Pho_PutSelectorForTypeOfAvg (void)
TypeOfAvg < Pho_NUM_AVERAGE_PHOTO_TYPES;
TypeOfAvg++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) TypeOfAvg);
if (TypeOfAvg == Gbl.Stat.DegPhotos.TypeOfAverage)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s</option>",Txt_AVERAGE_PHOTO_TYPES[TypeOfAvg]);
TypeOfAvgUnsigned = (unsigned) TypeOfAvg;
HTM_OPTION (HTM_Type_UNSIGNED,&TypeOfAvgUnsigned,
TypeOfAvg == Gbl.Stat.DegPhotos.TypeOfAverage,false,
"%s",Txt_AVERAGE_PHOTO_TYPES[TypeOfAvg]);
}
HTM_SELECT_End ();
Frm_EndForm ();
@ -1847,6 +1848,7 @@ static void Pho_PutSelectorForHowComputePhotoSize (void)
extern const char *Txt_Size_of_photos;
extern const char *Txt_STAT_DEGREE_PHOTO_SIZE[Pho_NUM_HOW_COMPUTE_PHOTO_SIZES];
Pho_HowComputePhotoSize_t PhoSi;
unsigned PhoSiUnsigned;
HTM_TR_Begin (NULL);
@ -1867,10 +1869,10 @@ static void Pho_PutSelectorForHowComputePhotoSize (void)
PhoSi < Pho_NUM_HOW_COMPUTE_PHOTO_SIZES;
PhoSi++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) PhoSi);
if (PhoSi == Gbl.Stat.DegPhotos.HowComputePhotoSize)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s</option>",Txt_STAT_DEGREE_PHOTO_SIZE[PhoSi]);
PhoSiUnsigned = (unsigned) PhoSi;
HTM_OPTION (HTM_Type_UNSIGNED,&PhoSiUnsigned,
PhoSi == Gbl.Stat.DegPhotos.HowComputePhotoSize,false,
"%s",Txt_STAT_DEGREE_PHOTO_SIZE[PhoSi]);
}
HTM_SELECT_End ();
Frm_EndForm ();
@ -1911,6 +1913,7 @@ static void Pho_PutSelectorForHowOrderDegrees (void)
extern const char *Txt_Sort_degrees_by;
extern const char *Txt_STAT_DEGREE_PHOTO_ORDER[Pho_NUM_HOW_ORDER_DEGREES];
Pho_HowOrderDegrees_t Order;
unsigned OrderUnsigned;
HTM_TR_Begin (NULL);
@ -1931,10 +1934,10 @@ static void Pho_PutSelectorForHowOrderDegrees (void)
Order < Pho_NUM_HOW_ORDER_DEGREES;
Order++)
{
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Order);
if (Order == Gbl.Stat.DegPhotos.HowOrderDegrees)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s</option>",Txt_STAT_DEGREE_PHOTO_ORDER[Order]);
OrderUnsigned = (unsigned) Order;
HTM_OPTION (HTM_Type_UNSIGNED,&OrderUnsigned,
Order == Gbl.Stat.DegPhotos.HowOrderDegrees,false,
"%s",Txt_STAT_DEGREE_PHOTO_ORDER[Order]);
}
HTM_SELECT_End ();
Frm_EndForm ();
@ -1997,6 +2000,8 @@ static void Pho_PutLinkToCalculateDegreeStats (void)
struct Degree Deg;
long EstimatedTimeToComputeAvgPhotoInMicroseconds;
char StrEstimatedTimeToComputeAvgPhoto[Dat_MAX_BYTES_TIME + 1];
bool Selected;
bool Disabled;
if ((Deg.DegCod = Pho_GetDegWithAvgPhotoLeastRecentlyUpdated ()) > 0)
{
@ -2037,15 +2042,17 @@ static void Pho_PutLinkToCalculateDegreeStats (void)
Sta_WriteTime (StrEstimatedTimeToComputeAvgPhoto,
EstimatedTimeToComputeAvgPhotoInMicroseconds);
fprintf (Gbl.F.Out,"<option value=\"%ld\"%s>%s (%s: %s)</option>",
Degs.Lst[NumDeg].DegCod,
Degs.Lst[NumDeg].DegCod == Deg.DegCod ? " selected=\"selected\"" :
((Pho_GetTimeAvgPhotoWasComputed (Degs.Lst[NumDeg].DegCod) >=
Gbl.StartExecutionTimeUTC - Cfg_MIN_TIME_TO_RECOMPUTE_AVG_PHOTO) ? " disabled=\"disabled\"" :
""),
Degs.Lst[NumDeg].ShrtName,
Txt_time,
StrEstimatedTimeToComputeAvgPhoto);
Selected = (Degs.Lst[NumDeg].DegCod == Deg.DegCod);
if (Selected)
Disabled = false;
else
// Too recently computed ?
Disabled = Pho_GetTimeAvgPhotoWasComputed (Degs.Lst[NumDeg].DegCod) >=
Gbl.StartExecutionTimeUTC - Cfg_MIN_TIME_TO_RECOMPUTE_AVG_PHOTO;
HTM_OPTION (HTM_Type_LONG,&Degs.Lst[NumDeg].DegCod,Selected,Disabled,
"%s (%s: %s)",
Degs.Lst[NumDeg].ShrtName,
Txt_time,StrEstimatedTimeToComputeAvgPhoto);
}
HTM_SELECT_End ();