mirror of https://github.com/acanas/swad-core.git
Version19.54.1
This commit is contained in:
parent
6ef4da55f2
commit
91e0df18c3
50
swad_HTML.c
50
swad_HTML.c
|
@ -1213,6 +1213,56 @@ void HTM_SELECT_End (void)
|
||||||
HTM_SELECT_NestingLevel--;
|
HTM_SELECT_NestingLevel--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HTM_OPTION (HTM_Type_t Type,void *ValuePtr,bool Selected,bool Disabled,
|
||||||
|
const char *fmt,...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
int NumBytesPrinted;
|
||||||
|
char *Content;
|
||||||
|
|
||||||
|
fprintf (Gbl.F.Out,"<option value=\"");
|
||||||
|
switch (Type)
|
||||||
|
{
|
||||||
|
case HTM_Type_UNSIGNED:
|
||||||
|
fprintf (Gbl.F.Out,"%u",*((unsigned *) ValuePtr));
|
||||||
|
break;
|
||||||
|
case HTM_Type_LONG:
|
||||||
|
fprintf (Gbl.F.Out,"%ld",*((long *) ValuePtr));
|
||||||
|
break;
|
||||||
|
case HTM_Type_STRING:
|
||||||
|
fprintf (Gbl.F.Out,"%s",(char *) ValuePtr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
fprintf (Gbl.F.Out,"\"");
|
||||||
|
if (Selected)
|
||||||
|
fprintf (Gbl.F.Out," selected=\"selected\"");
|
||||||
|
if (Disabled)
|
||||||
|
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||||
|
fprintf (Gbl.F.Out,">");
|
||||||
|
|
||||||
|
if (fmt)
|
||||||
|
{
|
||||||
|
if (fmt[0])
|
||||||
|
{
|
||||||
|
va_start (ap,fmt);
|
||||||
|
NumBytesPrinted = vasprintf (&Content,fmt,ap);
|
||||||
|
va_end (ap);
|
||||||
|
|
||||||
|
if (NumBytesPrinted < 0) // If memory allocation wasn't possible,
|
||||||
|
// or some other error occurs,
|
||||||
|
// vasprintf will return -1
|
||||||
|
Lay_NotEnoughMemoryExit ();
|
||||||
|
|
||||||
|
/***** Print HTML *****/
|
||||||
|
fprintf (Gbl.F.Out,"%s",Content);
|
||||||
|
|
||||||
|
free ((void *) Content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf (Gbl.F.Out,"</option>");
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************************** Images ***********************************/
|
/********************************** Images ***********************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -35,6 +35,13 @@
|
||||||
/********************************* Public types ******************************/
|
/********************************* Public types ******************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HTM_Type_UNSIGNED,
|
||||||
|
HTM_Type_LONG,
|
||||||
|
HTM_Type_STRING,
|
||||||
|
} HTM_Type_t;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************************** Public prototypes ****************************/
|
/****************************** Public prototypes ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -116,6 +123,8 @@ void HTM_TEXTAREA_End (void);
|
||||||
void HTM_SELECT_Begin (bool SubmitOnChange,
|
void HTM_SELECT_Begin (bool SubmitOnChange,
|
||||||
const char *fmt,...);
|
const char *fmt,...);
|
||||||
void HTM_SELECT_End (void);
|
void HTM_SELECT_End (void);
|
||||||
|
void HTM_OPTION (HTM_Type_t Type,void *ValuePtr,bool Selected,bool Disabled,
|
||||||
|
const char *fmt,...);
|
||||||
|
|
||||||
void HTM_IMG (const char *URL,const char *Icon,const char *Title,
|
void HTM_IMG (const char *URL,const char *Icon,const char *Title,
|
||||||
const char *fmt,...);
|
const char *fmt,...);
|
||||||
|
|
|
@ -354,9 +354,9 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
|
||||||
Frm_SetAnchorStr (Asg.AsgCod,&Anchor);
|
Frm_SetAnchorStr (Asg.AsgCod,&Anchor);
|
||||||
|
|
||||||
/***** Write first row of data of this assignment *****/
|
/***** Write first row of data of this assignment *****/
|
||||||
/* Forms to remove/edit this assignment */
|
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
|
/* Forms to remove/edit this assignment */
|
||||||
if (PrintView)
|
if (PrintView)
|
||||||
HTM_TD_Begin ("rowspan=\"2\" class=\"CONTEXT_COL\"");
|
HTM_TD_Begin ("rowspan=\"2\" class=\"CONTEXT_COL\"");
|
||||||
else
|
else
|
||||||
|
@ -414,11 +414,12 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
|
||||||
|
|
||||||
/* Assignment folder */
|
/* Assignment folder */
|
||||||
if (PrintView)
|
if (PrintView)
|
||||||
HTM_TD_Begin ("class=\"DAT LT");
|
HTM_TD_Begin ("class=\"DAT LT\"");
|
||||||
else
|
else
|
||||||
HTM_TD_Begin ("class=\"DAT LT COLOR%u",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"DAT LT COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
if (Asg.SendWork == Asg_SEND_WORK)
|
if (Asg.SendWork == Asg_SEND_WORK)
|
||||||
Asg_WriteAssignmentFolder (&Asg,PrintView);
|
Asg_WriteAssignmentFolder (&Asg,PrintView);
|
||||||
|
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
|
@ -1131,19 +1131,10 @@ void Att_RequestCreatOrEditAttEvent (void)
|
||||||
HTM_TD_Begin ("class=\"LT\"");
|
HTM_TD_Begin ("class=\"LT\"");
|
||||||
HTM_SELECT_Begin (false,
|
HTM_SELECT_Begin (false,
|
||||||
"id=\"ComTchVisible\" name=\"ComTchVisible\"");
|
"id=\"ComTchVisible\" name=\"ComTchVisible\"");
|
||||||
|
HTM_OPTION (HTM_Type_STRING,(void *) "N",!Att.CommentTchVisible,false,
|
||||||
fprintf (Gbl.F.Out,"<option value=\"N\"");
|
"%s",Txt_Hidden_MALE_PLURAL);
|
||||||
if (!Att.CommentTchVisible)
|
HTM_OPTION (HTM_Type_STRING,(void *) "Y",Att.CommentTchVisible,false,
|
||||||
fprintf (Gbl.F.Out," selected=\"selected\"");
|
"%s",Txt_Visible_MALE_PLURAL);
|
||||||
fprintf (Gbl.F.Out,">%s</option>",
|
|
||||||
Txt_Hidden_MALE_PLURAL);
|
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<option value=\"Y\"");
|
|
||||||
if (Att.CommentTchVisible)
|
|
||||||
fprintf (Gbl.F.Out," selected=\"selected\"");
|
|
||||||
fprintf (Gbl.F.Out,">%s</option>",
|
|
||||||
Txt_Visible_MALE_PLURAL);
|
|
||||||
|
|
||||||
HTM_SELECT_End ();
|
HTM_SELECT_End ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
|
@ -434,11 +434,9 @@ static void Ctr_Configuration (bool PrintView)
|
||||||
for (NumIns = 0;
|
for (NumIns = 0;
|
||||||
NumIns < Gbl.Hierarchy.Cty.Inss.Num;
|
NumIns < Gbl.Hierarchy.Cty.Inss.Num;
|
||||||
NumIns++)
|
NumIns++)
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%ld\"%s>%s</option>",
|
HTM_OPTION (HTM_Type_LONG,(void *) &Gbl.Hierarchy.Cty.Inss.Lst[NumIns].InsCod,
|
||||||
Gbl.Hierarchy.Cty.Inss.Lst[NumIns].InsCod,
|
Gbl.Hierarchy.Cty.Inss.Lst[NumIns].InsCod == Gbl.Hierarchy.Ins.InsCod,false,
|
||||||
Gbl.Hierarchy.Cty.Inss.Lst[NumIns].InsCod == Gbl.Hierarchy.Ins.InsCod ? " selected=\"selected\"" :
|
"%s",Gbl.Hierarchy.Cty.Inss.Lst[NumIns].ShrtName);
|
||||||
"",
|
|
||||||
Gbl.Hierarchy.Cty.Inss.Lst[NumIns].ShrtName);
|
|
||||||
HTM_SELECT_End ();
|
HTM_SELECT_End ();
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
|
||||||
|
@ -526,18 +524,15 @@ static void Ctr_Configuration (bool PrintView)
|
||||||
Frm_StartForm (ActChgCtrPlcCfg);
|
Frm_StartForm (ActChgCtrPlcCfg);
|
||||||
HTM_SELECT_Begin (true,
|
HTM_SELECT_Begin (true,
|
||||||
"name=\"PlcCod\" class=\"INPUT_SHORT_NAME\"");
|
"name=\"PlcCod\" class=\"INPUT_SHORT_NAME\"");
|
||||||
fprintf (Gbl.F.Out,"<option value=\"0\"");
|
HTM_OPTION (HTM_Type_STRING,(void *) "0",
|
||||||
if (Gbl.Hierarchy.Ctr.PlcCod == 0)
|
Gbl.Hierarchy.Ctr.PlcCod == 0,false,
|
||||||
fprintf (Gbl.F.Out," selected=\"selected\"");
|
"%s",Txt_Another_place);
|
||||||
fprintf (Gbl.F.Out,">%s</option>",Txt_Another_place);
|
|
||||||
for (NumPlc = 0;
|
for (NumPlc = 0;
|
||||||
NumPlc < Gbl.Plcs.Num;
|
NumPlc < Gbl.Plcs.Num;
|
||||||
NumPlc++)
|
NumPlc++)
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%ld\"%s>%s</option>",
|
HTM_OPTION (HTM_Type_LONG,(void *) &Gbl.Plcs.Lst[NumPlc].PlcCod,
|
||||||
Gbl.Plcs.Lst[NumPlc].PlcCod,
|
Gbl.Plcs.Lst[NumPlc].PlcCod == Gbl.Hierarchy.Ctr.PlcCod,false,
|
||||||
(Gbl.Plcs.Lst[NumPlc].PlcCod == Gbl.Hierarchy.Ctr.PlcCod) ? " selected=\"selected\"" :
|
"%s",Gbl.Plcs.Lst[NumPlc].ShrtName);
|
||||||
"",
|
|
||||||
Gbl.Plcs.Lst[NumPlc].ShrtName);
|
|
||||||
HTM_SELECT_End ();
|
HTM_SELECT_End ();
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
|
||||||
|
|
|
@ -490,7 +490,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.53.3 (2019-11-05)"
|
#define Log_PLATFORM_VERSION "SWAD 19.54.1 (2019-11-05)"
|
||||||
#define CSS_FILE "swad19.47.css"
|
#define CSS_FILE "swad19.47.css"
|
||||||
#define JS_FILE "swad19.39.js"
|
#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: 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.54.1: Nov 05, 2019 Fixed bug in assignments, reported by Eva Martínez Ortigosa. (246054 lines)
|
||||||
Version 19.54: Nov 05, 2019 Code refactoring in HTML select options. (? lines)
|
Version 19.54: Nov 05, 2019 Code refactoring in HTML select options. (? lines)
|
||||||
Version 19.53.3: Nov 05, 2019 Fixed bug in HTML form to upload files, reported by Eva Martínez Ortigosa. (246013 lines)
|
Version 19.53.3: Nov 05, 2019 Fixed bug in HTML form to upload files, reported by Eva Martínez Ortigosa. (246013 lines)
|
||||||
Version 19.53.2: Nov 05, 2019 Fixed bug in HTML input search. (246011 lines)
|
Version 19.53.2: Nov 05, 2019 Fixed bug in HTML input search. (246011 lines)
|
||||||
|
|
Loading…
Reference in New Issue