diff --git a/swad_centre.c b/swad_centre.c index fbc11c8f..4c065873 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -72,8 +72,9 @@ extern struct Globals Gbl; static void Ctr_Configuration (bool PrintView); static void Ctr_ListCentres (void); -static void Ctr_ListCentresForSeeing (void); +static void Ctr_ListCentresForSeeing (bool ICanEdit); static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr); +static void Ctr_PutIconToEdit (void); static void Ctr_GetParamCtrOrderType (void); static void Ctr_GetPhotoAttribution (long CtrCod,char **PhotoAttribution); static void Ctr_FreePhotoAttribution (char **PhotoAttribution); @@ -594,20 +595,15 @@ static void Ctr_ListCentres (void) bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_); if (Gbl.Ctrs.Num) // There are centres in the current institution - { - if (ICanEdit) - Lay_PutFormToEdit (ActEdiCtr); - Ctr_ListCentresForSeeing (); - } + Ctr_ListCentresForSeeing (ICanEdit); else // No centres created in the current institution - { Lay_ShowAlert (Lay_INFO,Txt_No_centres_have_been_created_in_this_institution); - if (ICanEdit) - { - Act_FormStart (ActEdiCtr); - Lay_PutConfirmButton (Txt_Create_centre); - Act_FormEnd (); - } + + if (ICanEdit) + { + Act_FormStart (ActEdiCtr); + Lay_PutConfirmButton (Txt_Create_centre); + Act_FormEnd (); } } @@ -615,7 +611,7 @@ static void Ctr_ListCentres (void) /*************** List the centres of the current institution *****************/ /*****************************************************************************/ -static void Ctr_ListCentresForSeeing (void) +static void Ctr_ListCentresForSeeing (bool ICanEdit) { extern const char *Txt_Centres_of_INSTITUTION_X; unsigned NumCtr; @@ -623,7 +619,10 @@ static void Ctr_ListCentresForSeeing (void) /***** Write heading *****/ sprintf (Gbl.Title,Txt_Centres_of_INSTITUTION_X, Gbl.CurrentIns.Ins.FullName); - Lay_StartRoundFrameTable (NULL,2,Gbl.Title); + Lay_StartRoundFrame (NULL,Gbl.Title, + ICanEdit ? Ctr_PutIconToEdit : + NULL); + fprintf (Gbl.F.Out,""); Ctr_PutHeadCentresForSeeing (true); // Order selectable /***** Write all the centres and their nuber of teachers *****/ @@ -633,6 +632,7 @@ static void Ctr_ListCentresForSeeing (void) Ctr_ListOneCentreForSeeing (&(Gbl.Ctrs.Lst[NumCtr]),NumCtr + 1); /***** Table end *****/ + fprintf (Gbl.F.Out,"
"); Lay_EndRoundFrameTable (); } @@ -727,6 +727,18 @@ static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr) Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; } + +/*****************************************************************************/ +/********************** Put link (form) to edit centres **********************/ +/*****************************************************************************/ + +static void Ctr_PutIconToEdit (void) + { + extern const char *Txt_Edit; + + Lay_PutContextualLink (ActEdiCtr,NULL,"edit64x64.png",Txt_Edit,NULL); + } + /*****************************************************************************/ /********** Get parameter with the type or order in list of centres **********/ /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index aeb10869..0ea3a864 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -129,13 +129,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.146.3 (2016-03-16)" +#define Log_PLATFORM_VERSION "SWAD 15.146.4 (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.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) Version 15.146.1: Mar 16, 2016 Icons to remove/edit/print an exam announcement integrated in frame. (195771 lines) diff --git a/swad_institution.c b/swad_institution.c index 3bf58575..7fac4684 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -530,7 +530,7 @@ static void Ins_ListInstitutions (void) if (Gbl.Inss.Num) // There are institutions in the current country Ins_ListInstitutionsForSeeing (ICanEdit); - else + else // No insrtitutions created in the current country Lay_ShowAlert (Lay_INFO,Txt_No_institutions_have_been_created_in_this_country); if (ICanEdit)