From 49b14e33a181d379d391d2451a7163b824716b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 16 Mar 2016 12:59:57 +0100 Subject: [PATCH] Version 15.146.5 --- swad_centre.c | 3 +-- swad_changelog.h | 3 ++- swad_degree.c | 43 +++++++++++++++++++++++++++---------------- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/swad_centre.c b/swad_centre.c index 4c065873f..42ddf972e 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -633,7 +633,7 @@ static void Ctr_ListCentresForSeeing (bool ICanEdit) /***** Table end *****/ fprintf (Gbl.F.Out,""); - Lay_EndRoundFrameTable (); + Lay_EndRoundFrame (); } /*****************************************************************************/ @@ -727,7 +727,6 @@ static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr) Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; } - /*****************************************************************************/ /********************** Put link (form) to edit centres **********************/ /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 0ea3a8649..2def7e8fa 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -129,13 +129,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.146.4 (2016-03-16)" +#define Log_PLATFORM_VERSION "SWAD 15.146.5 (2016-03-16)" #define CSS_FILE "swad15.146.css" #define JS_FILE "swad15.131.3.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 15.146.5: Mar 16, 2016 Icons to edit degrees integrated in frame. (195806 lines) Version 15.146.4: Mar 16, 2016 Icons to edit centres integrated in frame. (195798 lines) Version 15.146.3: Mar 16, 2016 Icons to edit institutions integrated in frame. (195790 lines) Version 15.146.2: Mar 16, 2016 Icons to edit countries integrated in frame. (195781 lines) diff --git a/swad_degree.c b/swad_degree.c index 1bc0c72b7..ea7530015 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -91,7 +91,7 @@ static void Deg_WriteSelectorOfDegree (void); static void Deg_EditDegreeTypes (void); static void Deg_ListDegreeTypesForSeeing (void); static void Deg_ListDegreeTypesForEdition (void); -static void Deg_ListDegreesForSeeing (void); +static void Deg_ListDegreesForSeeing (bool ICanEdit); static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg); static void Deg_ListDegreesForEdition (void); static bool Deg_CheckIfICanEdit (struct Degree *Deg); @@ -101,6 +101,7 @@ static void Deg_PutFormToCreateDegType (void); static void Deg_PutFormToCreateDegree (void); static void Deg_PutHeadDegreeTypesForSeeing (void); static void Deg_PutHeadDegreeTypesForEdition (void); +static void Deg_PutIconToEdit (void); static void Deg_PutHeadDegreesForSeeing (void); static void Deg_PutHeadDegreesForEdition (void); static void Deg_CreateDegreeType (struct DegreeType *DegTyp); @@ -1266,7 +1267,7 @@ static void Deg_ListDegreeTypesForEdition (void) /********************** List current degrees for seeing **********************/ /*****************************************************************************/ -static void Deg_ListDegreesForSeeing (void) +static void Deg_ListDegreesForSeeing (bool ICanEdit) { extern const char *Txt_Degrees_of_CENTRE_X; unsigned NumDeg; @@ -1274,7 +1275,10 @@ static void Deg_ListDegreesForSeeing (void) /***** Write heading *****/ sprintf (Gbl.Title,Txt_Degrees_of_CENTRE_X, Gbl.CurrentCtr.Ctr.ShortName); - Lay_StartRoundFrameTable (NULL,2,Gbl.Title); + Lay_StartRoundFrame (NULL,Gbl.Title, + ICanEdit ? Deg_PutIconToEdit : + NULL); + fprintf (Gbl.F.Out,""); Deg_PutHeadDegreesForSeeing (); /***** List the degrees *****/ @@ -1284,7 +1288,8 @@ static void Deg_ListDegreesForSeeing (void) Deg_ListOneDegreeForSeeing (&(Gbl.CurrentCtr.LstDegs[NumDeg]),NumDeg + 1); /***** Table end *****/ - Lay_EndRoundFrameTable (); + fprintf (Gbl.F.Out,"
"); + Lay_EndRoundFrame (); } /*****************************************************************************/ @@ -1871,6 +1876,17 @@ static void Deg_PutHeadDegreeTypesForEdition (void) Txt_Degrees_ABBREVIATION); } +/*****************************************************************************/ +/********************** Put link (form) to edit centres **********************/ +/*****************************************************************************/ + +static void Deg_PutIconToEdit (void) + { + extern const char *Txt_Edit; + + Lay_PutContextualLink (ActEdiDeg,NULL,"edit64x64.png",Txt_Edit,NULL); + } + /*****************************************************************************/ /******************** Write header with fields of a degree *******************/ /*****************************************************************************/ @@ -2037,20 +2053,15 @@ static void Deg_ListDegrees (void) bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_); if (Gbl.CurrentCtr.Ctr.NumDegs) // There are degrees in the current centre - { - if (ICanEdit) - Lay_PutFormToEdit (ActEdiDeg); - Deg_ListDegreesForSeeing (); - } + Deg_ListDegreesForSeeing (ICanEdit); else // No degrees created in the current centre - { Lay_ShowAlert (Lay_INFO,Txt_No_degrees_have_been_created_in_this_centre); - if (ICanEdit) - { - Act_FormStart (ActEdiDeg); - Lay_PutConfirmButton (Txt_Create_degree); - Act_FormEnd (); - } + + if (ICanEdit) + { + Act_FormStart (ActEdiDeg); + Lay_PutConfirmButton (Txt_Create_degree); + Act_FormEnd (); } }