From 8a3cc6a5946c48707c9992a45ea2376aaf76dd0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 24 Apr 2017 01:56:57 +0200 Subject: [PATCH] Version 16.186 --- css/swad16.185.3.css | 17 ++++---- swad_changelog.h | 5 ++- swad_config.h | 4 +- swad_text.c | 92 ++++++++++++++++++++++---------------------- swad_timetable.c | 70 ++++++++++++++++++++------------- 5 files changed, 104 insertions(+), 84 deletions(-) diff --git a/css/swad16.185.3.css b/css/swad16.185.3.css index aaeca9de..799aad00 100644 --- a/css/swad16.185.3.css +++ b/css/swad16.185.3.css @@ -2381,14 +2381,15 @@ a:hover img.CENTRE_PHOTO_SHOW font-size:10pt; letter-spacing:0; } -.TT_HOUR {height:40px;} -.TT_FREE0 {height:20px; background-color:#F4F2EA; border:solid 1px; border-color:#F4F2EA #E0D9C2 #EEEADC #F4F2EA;} -.TT_FREE1 {height:20px; background-color:#F4F2EA; border:solid 1px; border-color:#F4F2EA #E0D9C2 #E0D9C2 #F4F2EA;} -.TT_FREE2 {height:20px; background-color:#FBFAF7; border:solid 1px; border-color:#FBFAF7 #E0D9C2 #F5F2E9 #FBFAF7;} -.TT_FREE3 {height:20px; background-color:#FBFAF7; border:solid 1px; border-color:#FBFAF7 #E0D9C2 #E0D9C2 #FBFAF7;} -.TT_THEO {height:20px; background-color:#C0DAE4; border:solid 2px; border-color:#C9E3ED #B5CFD9 #B5CFD9 #C9E3ED;} -.TT_PRAC {height:20px; background-color:#DBE5E9; border:solid 2px; border-color:#E4EEF2 #D0DADE #D0DADE #E4EEF2;} -.TT_TUTO {height:20px; background-color:#D6E9C3; border:solid 2px; border-color:#DFEEE0 #CAE3B1 #CAE3B1 #DFEEE0;} +.TT_HOUR {height:20px;} +.TT_ALIGN {height:10px;} +.TT_FREE0 {height:10px; background-color:#F4F2EA; border:solid 1px; border-color:#F4F2EA #E0D9C2 #EEEADC #F4F2EA;} +.TT_FREE1 {height:10px; background-color:#F4F2EA; border:solid 1px; border-color:#F4F2EA #E0D9C2 #E0D9C2 #F4F2EA;} +.TT_FREE2 {height:10px; background-color:#FBFAF7; border:solid 1px; border-color:#FBFAF7 #E0D9C2 #F5F2E9 #FBFAF7;} +.TT_FREE3 {height:10px; background-color:#FBFAF7; border:solid 1px; border-color:#FBFAF7 #E0D9C2 #E0D9C2 #FBFAF7;} +.TT_THEO {height:10px; background-color:#C0DAE4; border:solid 2px; border-color:#C9E3ED #B5CFD9 #B5CFD9 #C9E3ED;} +.TT_PRAC {height:10px; background-color:#DBE5E9; border:solid 2px; border-color:#E4EEF2 #D0DADE #D0DADE #E4EEF2;} +.TT_TUTO {height:10px; background-color:#D6E9C3; border:solid 2px; border-color:#DFEEE0 #CAE3B1 #CAE3B1 #DFEEE0;} /********************************* Preference ********************************/ .PREF_CONTAINER diff --git a/swad_changelog.h b/swad_changelog.h index eff70304..340eed6b 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -213,17 +213,20 @@ // TODO: Changes in timetable (hours end in 24h). +// TODO: Fix bug: An URL like https://openswad.org/es?a gives Internal Server Error + /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.185.4 (2017-04-21)" +#define Log_PLATFORM_VERSION "SWAD 16.186 (2017-04-24)" #define CSS_FILE "swad16.185.3.css" #define JS_FILE "swad16.181.js" // 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 /* + Version 16.186: Apr 24, 2017 Changes in timetable. Not finished. (217867 lines) Version 16.185.4: Apr 21, 2017 Warning about Java no longer working. (217849 lines) Version 16.185.3: Apr 20, 2017 Timetables end at 24h, suggested by Sandra Daniela Tazzioli Barroso. (217797 lines) Version 16.185.2: Apr 19, 2017 Changes in forums. (217793 lines) diff --git a/swad_config.h b/swad_config.h index e0663d6f..a7c3a267 100644 --- a/swad_config.h +++ b/swad_config.h @@ -51,8 +51,8 @@ #define Cfg_PLATFORM_SHORT_NAME "SWAD local" #define Cfg_PLATFORM_FULL_NAME "SWAD (Shared Workspace At a Distance)" #define Cfg_PLATFORM_SERVER "localhost" // Server name (main part of the URL) -#define Cfg_URL_SWAD_SERVER "https://localhost/swad/" // With ending slash -#define Cfg_URL_SWAD_CGI "https://localhost/swad" // Without ending slash +#define Cfg_URL_SWAD_SERVER "https://localhost/" // With ending slash +#define Cfg_URL_SWAD_CGI "https://localhost" // Without ending slash #define Cfg_URL_SWAD_PUBLIC "https://localhost/swad" // Without ending slash #define Cfg_PATH_CGI_BIN "/usr/lib/cgi-bin/swad" // Directory for this CGI and other commands called by it #define Cfg_PATH_SWAD_PUBLIC "/var/www/html/swad" // Main public directory for public SWAD pages, icons, etc. diff --git a/swad_text.c b/swad_text.c index b4fabf15..d2f05b6b 100644 --- a/swad_text.c +++ b/swad_text.c @@ -41163,57 +41163,13 @@ const char *Txt_Tag_X_not_allowed_Click_to_allow_it = // Warning: it is very imp #if defined LOCALHOST_UBUNTU // localhost (Ubuntu) ***************** -const char *Txt_TAGLINE = -# if L==1 - "plataforma de suport a la docència"; -# elif L==2 - "Plattform zur Unterstützung der Lehre"; -# elif L==3 - "platform to support teaching"; -# elif L==4 - "plataforma de apoyo a la docencia"; -# elif L==5 - "plate-forme pour appuyer l'enseignement"; -# elif L==6 - "plataforma de apoyo a la docencia"; // Okoteve traducción -# elif L==7 - "piattaforma per sostenere l'insegnamento"; -# elif L==8 - "platforma do wspierania nauczania"; -# elif L==9 - "plataforma de apoio ao ensino"; -# endif - -const char *Txt_TAGLINE_BR = -# if L==1 - "plataforma de suport
a la docència"; -# elif L==2 - "Plattform zur
Unterstützung der Lehre"; -# elif L==3 - "platform to
support teaching"; -# elif L==4 - "plataforma de apoyo
a la docencia"; -# elif L==5 - "plate-forme pour
appuyer l'enseignement"; -# elif L==6 - "plataforma de apoyo
a la docencia"; // Okoteve traducción -# elif L==7 - "piattaforma per
sostenere l'insegnamento"; -# elif L==8 - "platforma do
wspierania nauczania"; -# elif L==9 - "plataforma de
apoio ao ensino"; -# endif - -#elif defined OPENSWAD_ORG // openswad.org *********************** - const char *Txt_TAGLINE = # if L==1 "plataforma educativa"; # elif L==2 "Bildungsplattform"; # elif L==3 - "educational platform"; + "social learning platform"; # elif L==4 "plataforma educativa"; # elif L==5 @@ -41234,7 +41190,51 @@ const char *Txt_TAGLINE_BR = # elif L==2 "Bildungs-
plattform"; # elif L==3 - "educational
platform"; + "social learning
platform"; +# elif L==4 + "plataforma
educativa"; +# elif L==5 + "plate-forme
éducative"; +# elif L==6 + "plataforma
educativa"; // Okoteve traducción +# elif L==7 + "piattaforma
educativa"; +# elif L==8 + "platforma
edukacyjna"; +# elif L==9 + "plataforma
educacional"; +# endif + +#elif defined OPENSWAD_ORG // openswad.org *********************** + +const char *Txt_TAGLINE = +# if L==1 + "plataforma educativa"; +# elif L==2 + "Bildungsplattform"; +# elif L==3 + "social learning platform"; +# elif L==4 + "plataforma educativa"; +# elif L==5 + "plate-forme éducative"; +# elif L==6 + "plataforma educativa"; // Okoteve traducción +# elif L==7 + "piattaforma educativa"; +# elif L==8 + "platforma edukacyjna"; +# elif L==9 + "plataforma educacional"; +# endif + +const char *Txt_TAGLINE_BR = +# if L==1 + "plataforma
educativa"; +# elif L==2 + "Bildungs-
plattform"; +# elif L==3 + "social learning
platform"; # elif L==4 "plataforma
educativa"; # elif L==5 diff --git a/swad_timetable.c b/swad_timetable.c index e786799f..ed03f1b5 100644 --- a/swad_timetable.c +++ b/swad_timetable.c @@ -52,6 +52,8 @@ extern struct Globals Gbl; #define TT_START_HOUR 6 // Day starts at 6:00 #define TT_HOURS_PER_DAY 18 // From 6:00 to 24:00 +// #define TT_HOURS_PER_DAY 2 // From 6:00 to 24:00 + #define TT_DAYS 7 // Seven days per week #define TT_MAX_COLUMNS_PER_CELL 3 // Maximum number of items (i.e. classes) in a timetable cell (1, 2, 3 or 4) #define TT_NUM_MINICOLUMNS_PER_DAY 6 // Least common multiple of 1,2,3,...,TT_MAX_COLUMNS_PER_CELL @@ -105,8 +107,8 @@ struct { unsigned NumColumns; struct TimeTableColumn Columns[TT_MAX_COLUMNS_PER_CELL]; - } TimeTable[TT_DAYS][TT_HOURS_PER_DAY * 2]; -bool TimeTableHoursChecked[TT_HOURS_PER_DAY * 2]; + } TimeTable[TT_DAYS][TT_HOURS_PER_DAY * 12]; +bool TimeTableHoursChecked[TT_HOURS_PER_DAY * 12]; /*****************************************************************************/ /***************************** Internal prototypes **************************/ @@ -834,6 +836,7 @@ static void TT_DrawTimeTable (void) unsigned DayColumn; // Column from left (0) to right (6) unsigned Day; // Day of week unsigned Hour; + unsigned Min; unsigned H; unsigned Column; unsigned ColumnsToDraw; @@ -863,7 +866,7 @@ static void TT_DrawTimeTable (void) /***** Row with day names *****/ fprintf (Gbl.F.Out,"" "" + " style=\"width:%u%%; background:grey;\">" "%u:00" "", TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN,TT_START_HOUR); @@ -871,11 +874,12 @@ static void TT_DrawTimeTable (void) TT_TimeTableDrawDaysCells (); TT_DrawCellAlignTimeTable (); fprintf (Gbl.F.Out,"" + " style=\"width:%u%%; background:grey;\">" "%u:00" "" "", - TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN,TT_START_HOUR); + TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN, + TT_START_HOUR); /***** Get list of groups types and groups in this course *****/ if (Gbl.Action.Act == ActEdiCrsTT || @@ -883,20 +887,21 @@ static void TT_DrawTimeTable (void) Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS); /***** Write the table row by row *****/ - for (Hour = 0; - Hour < TT_HOURS_PER_DAY * 2; - Hour++) + for (Hour = 0, Min = 5; + Hour < TT_HOURS_PER_DAY * 12; + Hour++, Min = (Min + 5) % 60) { fprintf (Gbl.F.Out,""); /* Hour */ - if (Hour % 2) - fprintf (Gbl.F.Out,"" - "%2u:00" + if (Hour % 2 == 1) + fprintf (Gbl.F.Out,"" + "%2u:%02u" "", TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN, - TT_START_HOUR + (Hour + 1) / 2); + TT_START_HOUR + (Hour + 2) / 12,Min); /* Empty column used to adjust height */ TT_DrawCellAlignTimeTable (); @@ -914,7 +919,7 @@ static void TT_DrawTimeTable (void) /* Check how many colums are needed. For each item (class) in this hour from left to right, we must check the maximum of columns */ for (H = 0; - H < TT_HOURS_PER_DAY * 2; + H < TT_HOURS_PER_DAY * 12; H++) TimeTableHoursChecked[H] = false; ColumnsToDraw = TT_TimeTableCalculateColsToDraw (Day,Hour); @@ -924,7 +929,7 @@ static void TT_DrawTimeTable (void) if (Editing && ColumnsToDraw < TT_MAX_COLUMNS_PER_CELL) ColumnsToDrawIncludingExtraColumn++; - /* Draw cells */ + /* Draw cells */ for (Column = 0, ContinuousFreeMinicolumns = 0; Column < ColumnsToDrawIncludingExtraColumn; Column++) @@ -956,13 +961,13 @@ static void TT_DrawTimeTable (void) TT_DrawCellAlignTimeTable (); /* Hour */ - if (Hour % 2) + if (Hour % 2 == 1) fprintf (Gbl.F.Out,"" - "%2u:00" + " style=\"width:%u%%; background:pink;\">" + "%2u:%02u" "", TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN, - TT_START_HOUR + (Hour + 1) / 2); + TT_START_HOUR + (Hour + 6) / 12,Min); fprintf (Gbl.F.Out,""); } @@ -996,11 +1001,16 @@ static void TT_TimeTableDrawAdjustRow (void) unsigned Minicolumn; fprintf (Gbl.F.Out,"" - "" + "" " " "", TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN); - TT_DrawCellAlignTimeTable (); + // TT_DrawCellAlignTimeTable (); + fprintf (Gbl.F.Out,"" + " " + "", + TT_PERCENT_WIDTH_OF_A_SEPARATION_COLUMN); for (Day = 0; Day < TT_DAYS; Day++) @@ -1008,13 +1018,18 @@ static void TT_TimeTableDrawAdjustRow (void) Minicolumn < TT_NUM_MINICOLUMNS_PER_DAY; Minicolumn++) fprintf (Gbl.F.Out,"" + " style=\"width:%u%%; background:yellow;\">" " " "", TT_PERCENT_WIDTH_OF_A_MINICOLUMN); - TT_DrawCellAlignTimeTable (); + // TT_DrawCellAlignTimeTable (); fprintf (Gbl.F.Out,"" + " style=\"width:%u%%; background:yellow;\">" + " " + "", + TT_PERCENT_WIDTH_OF_A_SEPARATION_COLUMN); + fprintf (Gbl.F.Out,"" " " "" "", @@ -1036,7 +1051,8 @@ static void TT_TimeTableDrawDaysCells (void) DayColumn++) { Day = (DayColumn + Gbl.Prefs.FirstDayOfWeek) % 7; - fprintf (Gbl.F.Out,"" "%s" "", @@ -1113,8 +1129,8 @@ static unsigned TT_TimeTableCalculateColsToDraw (unsigned Day,unsigned Hour) static void TT_DrawCellAlignTimeTable (void) { - fprintf (Gbl.F.Out,"" - " " + fprintf (Gbl.F.Out,"" "", TT_PERCENT_WIDTH_OF_A_SEPARATION_COLUMN); }