Version 16.89

This commit is contained in:
Antonio Cañas Vargas 2016-12-06 18:04:12 +01:00
parent b5fcc59299
commit fec29d76a2
7 changed files with 88 additions and 65 deletions

View File

@ -58,9 +58,9 @@ extern struct Globals Gbl;
#define Agd_NUM_AGENDA_TYPES 4
typedef enum
{
Agd_USR_AGENDA_NOW,
Agd_USR_AGENDA_TODAY,
Agd_USR_AGENDA,
Agd_MY_AGENDA_NOW,
Agd_MY_AGENDA_TODAY,
Agd_MY_AGENDA,
} Agd_AgendaType_t;
@ -147,7 +147,7 @@ void Agd_ShowUsrAgendaAfterLogIn (void)
Hlp_PROFILE_Agenda); // TODO: Change
/***** Show the current events in the user's agenda *****/
Agd_ShowEventsNow (Agd_USR_AGENDA_NOW);
Agd_ShowEventsNow (Agd_USR_AGENDA_TODAY);
/***** Show all the visible events in the user's agenda *****/
Agd_ShowEvents (Agd_USR_AGENDA);
@ -188,7 +188,7 @@ void Agd_ShowUsrAgenda (void)
Hlp_PROFILE_Agenda); // TODO: Change
/***** Show the current events in the user's agenda *****/
Agd_ShowEventsNow (Agd_USR_AGENDA_NOW);
Agd_ShowEventsNow (Agd_USR_AGENDA_TODAY);
/***** Show all the visible events in the user's agenda *****/
Agd_ShowEvents (Agd_USR_AGENDA);
@ -237,8 +237,7 @@ void Agd_ShowMyAgenda (void)
Act_FormEnd ();
/***** Show the current events in the user's agenda *****/
if (Gbl.Agenda.WhichEvents == Agd_ONLY_PUBLIC_EVENTS)
Agd_ShowEventsNow (Agd_MY_AGENDA_NOW);
Agd_ShowEventsNow (Agd_MY_AGENDA_TODAY);
/***** Show all my events *****/
Agd_ShowEvents (Agd_MY_AGENDA);
@ -323,7 +322,7 @@ static void Agd_ShowEvents (Agd_AgendaType_t AgendaType)
static void Agd_ShowEventsNow (Agd_AgendaType_t AgendaType)
{
extern const char *Hlp_PROFILE_Agenda;
extern const char *Txt_Now;
extern const char *Txt_Today;
extern const char *Txt_Public_agenda_USER;
extern const char *Txt_My_agenda;
extern const char *Txt_No_events;
@ -338,9 +337,9 @@ static void Agd_ShowEventsNow (Agd_AgendaType_t AgendaType)
if (Gbl.Agenda.Num)
{
/***** Start frame *****/
Lay_StartRoundFrameTable (NULL,Txt_Now,
NULL,
Hlp_PROFILE_Agenda,2); // TODO: Change
Lay_StartRoundFrameTableShadow (NULL,Txt_Today,
NULL,
Hlp_PROFILE_Agenda,2); // TODO: Change
/***** Table head *****/
Agd_WriteHeaderListEvents (AgendaType);
@ -380,12 +379,12 @@ static void Agd_WriteHeaderListEvents (Agd_AgendaType_t AgendaType)
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE\">");
switch (AgendaType)
{
case Agd_USR_AGENDA_NOW:
case Agd_USR_AGENDA_TODAY:
case Agd_USR_AGENDA:
Act_FormStart (ActSeeUsrAgd);
Usr_PutParamOtherUsrCodEncrypted ();
break;
case Agd_MY_AGENDA_NOW:
case Agd_MY_AGENDA_TODAY:
case Agd_MY_AGENDA:
Act_FormStart (ActSeeMyAgd);
break;
@ -578,11 +577,11 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod)
AgdEvent.AgdCod = AgdCod;
switch (AgendaType)
{
case Agd_USR_AGENDA_NOW:
case Agd_USR_AGENDA_TODAY:
case Agd_USR_AGENDA:
AgdEvent.UsrCod = Gbl.Usrs.Other.UsrDat.UsrCod;
break;
case Agd_MY_AGENDA_NOW:
case Agd_MY_AGENDA_TODAY:
case Agd_MY_AGENDA:
AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
break;
@ -849,10 +848,11 @@ static void Agd_GetListEvents (Agd_AgendaType_t AgendaType)
}
switch (AgendaType)
{
case Agd_USR_AGENDA_NOW:
case Agd_USR_AGENDA_TODAY:
sprintf (Query,"SELECT AgdCod FROM agendas"
" WHERE UsrCod='%ld' AND Public='Y' AND Hidden='N'"
" AND StartTime<=NOW() AND EndTime>=NOW()" // Only present events
" AND DATE(StartTime)<=CURDATE()"
" AND DATE(EndTime)>=CURDATE()" // Only today events
" ORDER BY %s",
Gbl.Usrs.Other.UsrDat.UsrCod,OrderBySubQuery);
break;
@ -863,12 +863,26 @@ static void Agd_GetListEvents (Agd_AgendaType_t AgendaType)
" ORDER BY %s",
Gbl.Usrs.Other.UsrDat.UsrCod,OrderBySubQuery);
break;
case Agd_MY_AGENDA_NOW:
sprintf (Query,"SELECT AgdCod FROM agendas"
" WHERE UsrCod='%ld' AND Public='Y' AND Hidden='N'"
" AND StartTime<=NOW() AND EndTime>=NOW()" // Only present events
" ORDER BY %s",
Gbl.Usrs.Me.UsrDat.UsrCod,OrderBySubQuery);
case Agd_MY_AGENDA_TODAY:
switch (Gbl.Agenda.WhichEvents)
{
case Agd_ALL_EVENTS:
sprintf (Query,"SELECT AgdCod FROM agendas"
" WHERE UsrCod='%ld'"
" AND DATE(StartTime)<=CURDATE()"
" AND DATE(EndTime)>=CURDATE()" // Only today events
" ORDER BY %s",
Gbl.Usrs.Me.UsrDat.UsrCod,OrderBySubQuery);
break;
case Agd_ONLY_PUBLIC_EVENTS:
sprintf (Query,"SELECT AgdCod FROM agendas"
" WHERE UsrCod='%ld' AND Public='Y' AND Hidden='N'"
" AND DATE(StartTime)<=CURDATE()"
" AND DATE(EndTime)>=CURDATE()" // Only today events
" ORDER BY %s",
Gbl.Usrs.Me.UsrDat.UsrCod,OrderBySubQuery);
break;
}
break;
case Agd_MY_AGENDA:
switch (Gbl.Agenda.WhichEvents)

View File

@ -183,13 +183,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.88.1 (2016-12-06)"
#define Log_PLATFORM_VERSION "SWAD 16.89 (2016-12-06)"
#define CSS_FILE "swad16.86.5.css"
#define JS_FILE "swad16.84.2.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.89: Dec 06, 2016 Agenda events now are replaced by agenda events today. (210139 lines)
Version 16.88.1: Dec 06, 2016 Fixed bugs in agenda. (210118 lines)
Version 16.88: Dec 06, 2016 Current events in user's agenda are displayed in a highlighted box. (210102 lines)
Version 16.87.2: Dec 05, 2016 Icon to edit my agenda. (209987 lines)

View File

@ -9304,7 +9304,7 @@ void Brw_ShowFileMetadata (void)
}
/***** Start frame *****/
Lay_StartRoundFrameTableShadow (NULL,2);
Lay_StartRoundFrameTableShadow (NULL,NULL,NULL,NULL,2);
/***** Link to download the file *****/
fprintf (Gbl.F.Out,"<tr>"

View File

@ -95,6 +95,11 @@ static void Lay_WriteTitleAction (void);
static void Lay_ShowLeftColumn (void);
static void Lay_ShowRightColumn (void);
static void Lay_StartRoundFrameInternal (const char *Width,const char *Title,
void (*FunctionToDrawContextualIcons) (void),
const char *HelpLink,
const char *ClassFrame);
static void Lay_WriteAboutZone (void);
static void Lay_WriteFootFromHTMLFile (void);
@ -1316,17 +1321,51 @@ void Lay_StartRoundFrameTable (const char *Width,const char *Title,
fprintf (Gbl.F.Out,"\">");
}
void Lay_StartRoundFrameTableShadow (const char *Width,const char *Title,
void (*FunctionToDrawContextualIcons) (void),
const char *HelpLink,
unsigned CellPadding)
{
Lay_StartRoundFrameShadow (Width,Title,FunctionToDrawContextualIcons,HelpLink);
fprintf (Gbl.F.Out,"<table class=\"FRAME_TBL");
if (CellPadding)
fprintf (Gbl.F.Out," CELLS_PAD_%u",CellPadding); // CellPadding must be 0, 1, 2, 4 or 8
fprintf (Gbl.F.Out,"\">");
}
void Lay_StartRoundFrame (const char *Width,const char *Title,
void (*FunctionToDrawContextualIcons) (void),
const char *HelpLink)
{
Lay_StartRoundFrameInternal (Width,Title,
FunctionToDrawContextualIcons,
HelpLink,
"FRAME");
}
void Lay_StartRoundFrameShadow (const char *Width,const char *Title,
void (*FunctionToDrawContextualIcons) (void),
const char *HelpLink)
{
Lay_StartRoundFrameInternal (Width,Title,
FunctionToDrawContextualIcons,
HelpLink,
"FRAME_SHADOW");
}
static void Lay_StartRoundFrameInternal (const char *Width,const char *Title,
void (*FunctionToDrawContextualIcons) (void),
const char *HelpLink,
const char *ClassFrame)
{
extern const char *Txt_Help;
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\""
" style=\"box-sizing:border-box; width:100%%;\">"
"<div class=\"FRAME\"");
"<div class=\"%s\"",ClassFrame);
if (Width)
fprintf (Gbl.F.Out," style=\"box-sizing:border-box; width:%s;\"",Width);
fprintf (Gbl.F.Out," style=\"width:%s;\"",Width);
fprintf (Gbl.F.Out,">");
fprintf (Gbl.F.Out,"<div class=\"FRAME_ICO\">");
@ -1362,22 +1401,6 @@ void Lay_StartRoundFrame (const char *Width,const char *Title,
Gbl.Layout.FrameNested++;
}
// CellPadding must be 0, 1, 2, 4 or 8
void Lay_StartRoundFrameTableShadow (const char *Width,unsigned CellPadding)
{
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\""
" style=\"width:100%%;\">"
"<div class=\"FRAME_SHADOW\"");
if (Width)
fprintf (Gbl.F.Out," style=\"width:%s;\"",Width);
fprintf (Gbl.F.Out,">"
"<table class=\"FRAME_TBL");
if (CellPadding)
fprintf (Gbl.F.Out," CELLS_PAD_%u",CellPadding); // CellPadding must be 0, 1, 2, 4 or 8
fprintf (Gbl.F.Out,"\">");
}
void Lay_EndRoundFrameTable (void)
{
fprintf (Gbl.F.Out,"</table>");

View File

@ -105,7 +105,13 @@ void Lay_StartRoundFrameTable (const char *Width,const char *Title,
void Lay_StartRoundFrame (const char *Width,const char *Title,
void (*FunctionToDrawContextualIcons) (void),
const char *HelpLink);
void Lay_StartRoundFrameTableShadow (const char *Width,unsigned CellPadding);
void Lay_StartRoundFrameShadow (const char *Width,const char *Title,
void (*FunctionToDrawContextualIcons) (void),
const char *HelpLink);
void Lay_StartRoundFrameTableShadow (const char *Width,const char *Title,
void (*FunctionToDrawContextualIcons) (void),
const char *HelpLink,
unsigned CellPadding);
void Lay_EndRoundFrameTable (void);
void Lay_EndRoundFrameTableWithButton (Lay_Button_t Button,const char *TxtButton);
void Lay_EndRoundFrameWithButton (Lay_Button_t Button,const char *TxtButton);

View File

@ -26868,27 +26868,6 @@ const char *Txt_Notify_me_BR_by_email =
"Notifique-me<br />por email";
#endif
const char *Txt_Now =
#if L==1
"Ara";
#elif L==2
"Jetzt";
#elif L==3
"Now";
#elif L==4
"Ahora";
#elif L==5
"Maintenant";
#elif L==6
"Ko'&atilde;ga";
#elif L==7
"Ora";
#elif L==8
"Teraz";
#elif L==9
"Agora";
#endif
const char *Txt_Now_each_student_can_belong_to_multiple_groups_of_type_X = // Warning: it is very important to include %s in the following sentences
#if L==1
"Ahora cada estudiante puede pertenecer a varios grupos de tipo <strong>%s</strong>."; // Necessita traduccio

View File

@ -617,7 +617,7 @@ static void ZIP_ShowLinkToDownloadZIP (const char *FileName,const char *URL,
Str_LimitLengthHTMLStr (FileNameShort,50);
/***** Start frame *****/
Lay_StartRoundFrameTableShadow (NULL,2);
Lay_StartRoundFrameTableShadow (NULL,NULL,NULL,NULL,2);
/***** Link to download the file *****/
fprintf (Gbl.F.Out,"<tr>"