Version19.108.6

This commit is contained in:
Antonio Cañas Vargas 2019-12-30 20:41:40 +01:00
parent 359dd28b28
commit bb29e96ada
11 changed files with 61 additions and 53 deletions

View File

@ -2003,12 +2003,11 @@ void Ctr_ListCtrsFound (MYSQL_RES **mysql_res,unsigned NumCtrs)
{ {
/***** Begin box and table *****/ /***** Begin box and table *****/
/* Number of centres found */ /* Number of centres found */
snprintf (Gbl.Title,sizeof (Gbl.Title), Box_BoxTableBegin (NULL,Str_BuildMsgLongStr ((long) NumCtrs,
"%u %s", (NumCtrs == 1) ? Txt_centre :
NumCtrs,(NumCtrs == 1) ? Txt_centre : Txt_centres),
Txt_centres); NULL,NULL,Box_NOT_CLOSABLE,2);
Box_BoxTableBegin (NULL,Gbl.Title,NULL, Str_FreeMsg ();
NULL,Box_NOT_CLOSABLE,2);
/***** Write heading *****/ /***** Write heading *****/
Ctr_PutHeadCentresForSeeing (false); // Order not selectable Ctr_PutHeadCentresForSeeing (false); // Order not selectable

View File

@ -492,7 +492,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.108.5 (2019-12-30)" #define Log_PLATFORM_VERSION "SWAD 19.108.6 (2019-12-30)"
#define CSS_FILE "swad19.101.5.css" #define CSS_FILE "swad19.101.5.css"
#define JS_FILE "swad19.91.1.js" #define JS_FILE "swad19.91.1.js"
/* /*
@ -502,6 +502,7 @@ ps2pdf source.ps destination.pdf
Version 19.10x: Dec 30, 2019 Map in country information. (? lines) Version 19.10x: Dec 30, 2019 Map in country information. (? lines)
Version 19.10x: Dec 30, 2019 Map in institution information. (? lines) Version 19.10x: Dec 30, 2019 Map in institution information. (? lines)
Version 19.108.6: Dec 30, 2019 Code refactoring related to printing messages. (249717 lines)
Version 19.108.5: Dec 30, 2019 Code refactoring related to printing messages. (249712 lines) Version 19.108.5: Dec 30, 2019 Code refactoring related to printing messages. (249712 lines)
Version 19.108.4: Dec 30, 2019 Code refactoring related to printing messages. (249709 lines) Version 19.108.4: Dec 30, 2019 Code refactoring related to printing messages. (249709 lines)
Version 19.108.3: Dec 30, 2019 Code refactoring related to printing messages. (249725 lines) Version 19.108.3: Dec 30, 2019 Code refactoring related to printing messages. (249725 lines)

View File

@ -2044,12 +2044,11 @@ void Cty_ListCtysFound (MYSQL_RES **mysql_res,unsigned NumCtys)
{ {
/***** Begin box and table *****/ /***** Begin box and table *****/
/* Number of countries found */ /* Number of countries found */
snprintf (Gbl.Title,sizeof (Gbl.Title), Box_BoxTableBegin (NULL,Str_BuildMsgLongStr ((long) NumCtys,
"%u %s", NumCtys == 1 ? Txt_country :
NumCtys,NumCtys == 1 ? Txt_country : Txt_countries),
Txt_countries); NULL,NULL,Box_NOT_CLOSABLE,2);
Box_BoxTableBegin (NULL,Gbl.Title,NULL, Str_FreeMsg ();
NULL,Box_NOT_CLOSABLE,2);
/***** Write heading *****/ /***** Write heading *****/
Cty_PutHeadCountriesForSeeing (false); // Order not selectable Cty_PutHeadCountriesForSeeing (false); // Order not selectable

View File

@ -2505,12 +2505,11 @@ void Crs_ListCrssFound (MYSQL_RES **mysql_res,unsigned NumCrss)
{ {
/***** Begin box and table *****/ /***** Begin box and table *****/
/* Number of courses found */ /* Number of courses found */
snprintf (Gbl.Title,sizeof (Gbl.Title), Box_BoxTableBegin (NULL,Str_BuildMsgLongStr ((long) NumCrss,
"%u %s", (NumCrss == 1) ? Txt_course :
NumCrss,(NumCrss == 1) ? Txt_course : Txt_courses),
Txt_courses); NULL,NULL,Box_NOT_CLOSABLE,2);
Box_BoxTableBegin (NULL,Gbl.Title,NULL, Str_FreeMsg ();
NULL,Box_NOT_CLOSABLE,2);
/***** Heading row *****/ /***** Heading row *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);

View File

@ -1957,12 +1957,11 @@ void Deg_ListDegsFound (MYSQL_RES **mysql_res,unsigned NumDegs)
{ {
/***** Begin box and table *****/ /***** Begin box and table *****/
/* Number of degrees found */ /* Number of degrees found */
snprintf (Gbl.Title,sizeof (Gbl.Title), Box_BoxTableBegin (NULL,Str_BuildMsgLongStr ((long) NumDegs,
"%u %s", (NumDegs == 1) ? Txt_degree :
NumDegs,(NumDegs == 1) ? Txt_degree : Txt_degrees),
Txt_degrees); NULL,NULL,Box_NOT_CLOSABLE,2);
Box_BoxTableBegin (NULL,Gbl.Title,NULL, Str_FreeMsg ();
NULL,Box_NOT_CLOSABLE,2);
/***** Write heading *****/ /***** Write heading *****/
Deg_PutHeadDegreesForSeeing (); Deg_PutHeadDegreesForSeeing ();

View File

@ -11807,12 +11807,11 @@ void Brw_ListDocsFound (MYSQL_RES **mysql_res,unsigned long NumDocs,
{ {
/***** Begin box and table *****/ /***** Begin box and table *****/
/* Number of documents found */ /* Number of documents found */
snprintf (Gbl.Title,sizeof (Gbl.Title), Box_BoxTableBegin (NULL,Str_BuildMsgLongStr ((long) NumDocs,
"%lu %s", (NumDocs == 1) ? TitleSingular :
NumDocs,(NumDocs == 1) ? TitleSingular : TitlePlural),
TitlePlural); NULL,NULL,Box_NOT_CLOSABLE,2);
Box_BoxTableBegin (NULL,Gbl.Title,NULL, Str_FreeMsg ();
NULL,Box_NOT_CLOSABLE,2);
/***** Write heading *****/ /***** Write heading *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);

View File

@ -1968,12 +1968,11 @@ void Ins_ListInssFound (MYSQL_RES **mysql_res,unsigned NumInss)
{ {
/***** Begin box and table *****/ /***** Begin box and table *****/
/* Number of institutions found */ /* Number of institutions found */
snprintf (Gbl.Title,sizeof (Gbl.Title), Box_BoxTableBegin (NULL,Str_BuildMsgLongStr ((long) NumInss,
"%u %s", NumInss == 1 ? Txt_institution :
NumInss,NumInss == 1 ? Txt_institution : Txt_institutions),
Txt_institutions); NULL,NULL,Box_NOT_CLOSABLE,2);
Box_BoxTableBegin (NULL,Gbl.Title,NULL, Str_FreeMsg ();
NULL,Box_NOT_CLOSABLE,2);
/***** Write heading *****/ /***** Write heading *****/
Ins_PutHeadInstitutionsForSeeing (false); // Order not selectable Ins_PutHeadInstitutionsForSeeing (false); // Order not selectable

View File

@ -2696,24 +2696,27 @@ static void Mch_ShowFormColumns (const struct Match *Match)
NumCols <= Mch_MAX_COLS; NumCols <= Mch_MAX_COLS;
NumCols++) NumCols++)
{ {
/* Begin container for this option */
HTM_DIV_Begin ("class=\"%s\"", HTM_DIV_Begin ("class=\"%s\"",
(Match->Status.NumCols == NumCols) ? "PREF_ON" : (Match->Status.NumCols == NumCols) ? "PREF_ON" :
"PREF_OFF"); "PREF_OFF");
/***** Begin form *****/ /* Begin form */
Frm_StartForm (ActChgNumColMch); Frm_StartForm (ActChgNumColMch);
Mch_PutParamMchCod (Match->MchCod); // Current match being played Mch_PutParamMchCod (Match->MchCod); // Current match being played
Mch_PutParamNumCols (NumCols); // Number of columns Mch_PutParamNumCols (NumCols); // Number of columns
snprintf (Gbl.Title,sizeof (Gbl.Title), /* Number of columns */
"%u %s", Ico_PutSettingIconLink (NumColsIcon[NumCols],
NumCols,NumCols == 1 ? Txt_column : Str_BuildMsgLongStr ((long) NumCols,
Txt_columns); NumCols == 1 ? Txt_column :
Ico_PutSettingIconLink (NumColsIcon[NumCols],Gbl.Title); Txt_columns));
Str_FreeMsg ();
/***** End form *****/ /* End form */
Frm_EndForm (); Frm_EndForm ();
/* End container for this option */
HTM_DIV_End (); HTM_DIV_End ();
} }

View File

@ -2953,6 +2953,17 @@ char *Str_BuildMsgLong (const char *fmt,long Num)
return Str_Msg; return Str_Msg;
} }
// Str_FreeMsg() must be called after calling this function
char *Str_BuildMsgLongStr (long Num,const char *Str)
{
Str_FreeMsg ();
if (asprintf (&Str_Msg,"%ld %s",Num,Str) < 0)
Lay_NotEnoughMemoryExit ();
return Str_Msg;
}
void Str_FreeMsg (void) void Str_FreeMsg (void)
{ {
if (Str_Msg != NULL) if (Str_Msg != NULL)

View File

@ -138,6 +138,7 @@ void Str_Concat (char *Dst,const char *Src,size_t DstSize);
char *Str_BuildMsgStr (const char *fmt,const char *Str); char *Str_BuildMsgStr (const char *fmt,const char *Str);
char *Str_BuildMsgLong (const char *fmt,long Num); char *Str_BuildMsgLong (const char *fmt,long Num);
char *Str_BuildMsgLongStr (long Num,const char *Str);
void Str_FreeMsg (void); void Str_FreeMsg (void);
#endif #endif

View File

@ -7390,15 +7390,13 @@ unsigned Usr_ListUsrsFound (Rol_Role_t Role,
/***** Begin box and table *****/ /***** Begin box and table *****/
/* Number of users found */ /* Number of users found */
Sex = Usr_GetSexOfUsrsLst (Role); Sex = Usr_GetSexOfUsrsLst (Role);
snprintf (Gbl.Title,sizeof (Gbl.Title), Box_BoxTableBegin (NULL,Str_BuildMsgLongStr ((long) NumUsrs,
"%u %s", (Role == Rol_UNK) ? ((NumUsrs == 1) ? Txt_user[Sex] :
NumUsrs, Txt_users[Sex]) :
(Role == Rol_UNK) ? ((NumUsrs == 1) ? Txt_user[Sex] : ((NumUsrs == 1) ? Txt_ROLES_SINGUL_abc[Role][Sex] :
Txt_users[Sex]) : Txt_ROLES_PLURAL_abc[Role][Sex])),
((NumUsrs == 1) ? Txt_ROLES_SINGUL_abc[Role][Sex] : NULL,NULL,Box_NOT_CLOSABLE,2);
Txt_ROLES_PLURAL_abc[Role][Sex])); Str_FreeMsg ();
Box_BoxTableBegin (NULL,Gbl.Title,NULL,
NULL,Box_NOT_CLOSABLE,2);
/***** Heading row with column names *****/ /***** Heading row with column names *****/
Gbl.Usrs.Listing.WithPhotos = true; Gbl.Usrs.Listing.WithPhotos = true;