From 892b1a01e50443f5f1ae564f9c24c2e0b001c071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 7 Oct 2019 23:18:45 +0200 Subject: [PATCH] Version19.31.20 --- swad_centre.c | 133 +++++++++++++++++++++-------------------------- swad_changelog.h | 3 +- 2 files changed, 60 insertions(+), 76 deletions(-) diff --git a/swad_centre.c b/swad_centre.c index c6fbea26d..a3edf3626 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -760,16 +760,14 @@ static void Ctr_ShowNumUsrsInCrssOfCtr (Rol_Role_t Role) Tbl_StartRow (); - fprintf (Gbl.F.Out,"" - "%s:", - The_ClassFormInBox[Gbl.Prefs.Theme], + Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + fprintf (Gbl.F.Out,"%s:", (Role == Rol_UNK) ? Txt_Users_in_courses : Txt_ROLES_PLURAL_Abc[Role][Usr_SEX_UNKNOWN]); Tbl_EndCell (); - fprintf (Gbl.F.Out,"" - "%u", - Usr_GetNumUsrsInCrssOfCtr (Role,Gbl.Hierarchy.Ctr.CtrCod)); + Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%u",Usr_GetNumUsrsInCrssOfCtr (Role,Gbl.Hierarchy.Ctr.CtrCod)); Tbl_EndCell (); Tbl_EndRow (); @@ -921,60 +919,48 @@ static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr) Tbl_StartRow (); /***** Number of centre in this list *****/ - fprintf (Gbl.F.Out,"" - "%u", - TxtClassNormal,BgColor, - NumCtr); + Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE %s\"",TxtClassNormal,BgColor); + fprintf (Gbl.F.Out,"%u",NumCtr); Tbl_EndCell (); /***** Centre logo and name *****/ - fprintf (Gbl.F.Out,"",BgColor); + Tbl_StartCellAttr ("class=\"LEFT_MIDDLE %s\"",BgColor); Ctr_DrawCentreLogoAndNameWithLink (Ctr,ActSeeDeg, TxtClassStrong,"CENTER_MIDDLE"); Tbl_EndCell (); /***** Number of users who claim to belong to this centre *****/ - fprintf (Gbl.F.Out,"" - "%u", - TxtClassNormal,BgColor, - Ctr->NumUsrsWhoClaimToBelongToCtr); + Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE %s\"",TxtClassNormal,BgColor); + fprintf (Gbl.F.Out,"%u",Ctr->NumUsrsWhoClaimToBelongToCtr); Tbl_EndCell (); /***** Place *****/ - fprintf (Gbl.F.Out,"" - "%s", - TxtClassNormal,BgColor, - Plc.ShrtName); + Tbl_StartCellAttr ("class=\"%s LEFT_MIDDLE %s\"",TxtClassNormal,BgColor); + fprintf (Gbl.F.Out,"%s",Plc.ShrtName); Tbl_EndCell (); /***** Number of degrees *****/ - fprintf (Gbl.F.Out,"" - "%u", - TxtClassNormal,BgColor, - Ctr->Degs.Num); + Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE %s\"",TxtClassNormal,BgColor); + fprintf (Gbl.F.Out,"%u",Ctr->Degs.Num); Tbl_EndCell (); /***** Number of courses *****/ - fprintf (Gbl.F.Out,"" - "%u", - TxtClassNormal,BgColor, - Ctr->NumCrss); + Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE %s\"",TxtClassNormal,BgColor); + fprintf (Gbl.F.Out,"%u",Ctr->NumCrss); Tbl_EndCell (); /***** Number of users in courses of this centre *****/ - fprintf (Gbl.F.Out,"" - "%u", - TxtClassNormal,BgColor, - Ctr->NumUsrs); + Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE %s\"",TxtClassNormal,BgColor); + fprintf (Gbl.F.Out,"%u",Ctr->NumUsrs); Tbl_EndCell (); /***** Centre status *****/ StatusTxt = Ctr_GetStatusTxtFromStatusBits (Ctr->Status); - fprintf (Gbl.F.Out,"", - TxtClassNormal,BgColor); + Tbl_StartCellAttr ("class=\"%s LEFT_MIDDLE %s\"",TxtClassNormal,BgColor); if (StatusTxt != Ctr_STATUS_ACTIVE) // If active ==> do not show anything fprintf (Gbl.F.Out,"%s",Txt_CENTRE_STATUS[StatusTxt]); Tbl_EndCell (); + Tbl_EndRow (); Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; @@ -1512,7 +1498,7 @@ static void Ctr_ListCentresForEdition (void) /* Put icon to remove centre */ Tbl_StartRow (); - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"BM\""); if (Ctr->Degs.Num || Ctr->NumUsrsWhoClaimToBelongToCtr || Ctr->NumUsrs || // Centre has degrees or users ==> deletion forbidden @@ -1528,20 +1514,18 @@ static void Ctr_ListCentresForEdition (void) Tbl_EndCell (); /* Centre code */ - fprintf (Gbl.F.Out,"" - "%ld", - Ctr->CtrCod); + Tbl_StartCellAttr ("class=\"DAT CODE\""); + fprintf (Gbl.F.Out,"%ld",Ctr->CtrCod); Tbl_EndCell (); /* Centre logo */ - fprintf (Gbl.F.Out,"", - Ctr->FullName); + Tbl_StartCellAttr ("title=\"%s\" class=\"LEFT_MIDDLE\" style=\"width:25px;\"", + Ctr->FullName); Log_DrawLogo (Hie_CTR,Ctr->CtrCod,Ctr->ShrtName,20,NULL,true); Tbl_EndCell (); /* Place */ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\""); if (ICanEdit) { Frm_StartForm (ActChgCtrPlc); @@ -1573,7 +1557,7 @@ static void Ctr_ListCentresForEdition (void) Tbl_EndCell (); /* Centre short name */ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\""); if (ICanEdit) { Frm_StartForm (ActRenCtrSho); @@ -1591,7 +1575,7 @@ static void Ctr_ListCentresForEdition (void) Tbl_EndCell (); /* Centre full name */ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\""); if (ICanEdit) { Frm_StartForm (ActRenCtrFul); @@ -1609,7 +1593,7 @@ static void Ctr_ListCentresForEdition (void) Tbl_EndCell (); /* Centre WWW */ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\""); if (ICanEdit) { Frm_StartForm (ActChgCtrWWW); @@ -1636,33 +1620,30 @@ static void Ctr_ListCentresForEdition (void) Tbl_EndCell (); /* Number of users who claim to belong to this centre */ - fprintf (Gbl.F.Out,"" - "%u", - Ctr->NumUsrsWhoClaimToBelongToCtr); + Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%u",Ctr->NumUsrsWhoClaimToBelongToCtr); Tbl_EndCell (); /* Number of degrees */ - fprintf (Gbl.F.Out,"" - "%u", - Ctr->Degs.Num); + Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%u",Ctr->Degs.Num); Tbl_EndCell (); /* Number of users in courses of this centre */ - fprintf (Gbl.F.Out,"" - "%u", - Ctr->NumUsrs); + Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%u",Ctr->NumUsrs); Tbl_EndCell (); /* Centre requester */ UsrDat.UsrCod = Ctr->RequesterUsrCod; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS); - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"DAT INPUT_REQUESTER LEFT_TOP\""); Msg_WriteMsgAuthor (&UsrDat,true,NULL); Tbl_EndCell (); /* Centre status */ StatusTxt = Ctr_GetStatusTxtFromStatusBits (Ctr->Status); - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\""); if (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM && StatusTxt == Ctr_STATUS_PENDING) { @@ -2535,23 +2516,24 @@ static void Ctr_PutFormToCreateCentre (void) /***** Write heading *****/ Ctr_PutHeadCentresForEdition (); - /***** Column to remove centre, disabled here *****/ Tbl_StartRow (); - fprintf (Gbl.F.Out,""); + + /***** Column to remove centre, disabled here *****/ + Tbl_StartCellAttr ("class=\"BM\""); Tbl_EndCell (); /***** Centre code *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"CODE\""); Tbl_EndCell (); /***** Centre logo *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\" style=\"width:25px;\""); Log_DrawLogo (Hie_CTR,-1L,"",20,NULL,true); Tbl_EndCell (); /***** Place *****/ - fprintf (Gbl.F.Out,"" - "" "