diff --git a/swad_changelog.h b/swad_changelog.h index debbb7586..aeb10869b 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -129,13 +129,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.146.2 (2016-03-16)" +#define Log_PLATFORM_VERSION "SWAD 15.146.3 (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.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) Version 15.146: Mar 16, 2016 Now frame rectangles can have icons at top. diff --git a/swad_country.c b/swad_country.c index fa29de392..ec41c1116 100644 --- a/swad_country.c +++ b/swad_country.c @@ -501,7 +501,9 @@ void Cty_ListCountries2 (void) const char *BgColor; /***** Table head *****/ - Lay_StartRoundFrame (NULL,Txt_Countries,Cty_PutIconToEdit); + Lay_StartRoundFrame (NULL,Txt_Countries, + Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM ? Cty_PutIconToEdit : + NULL); fprintf (Gbl.F.Out,"" ""); for (Order = Cty_ORDER_BY_COUNTRY; @@ -684,8 +686,7 @@ static void Cty_PutIconToEdit (void) { extern const char *Txt_Edit; - if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) - Lay_PutContextualLink (ActEdiCty,NULL,"edit64x64.png",Txt_Edit,NULL); + Lay_PutContextualLink (ActEdiCty,NULL,"edit64x64.png",Txt_Edit,NULL); } /*****************************************************************************/ diff --git a/swad_institution.c b/swad_institution.c index 90d10ca6a..3bf585757 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -66,8 +66,9 @@ extern struct Globals Gbl; static void Ins_Configuration (bool PrintView); static void Ins_ListInstitutions (void); -static void Ins_ListInstitutionsForSeeing (void); +static void Ins_ListInstitutionsForSeeing (bool ICanEdit); static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned NumIns); +static void Ins_PutIconToEdit (void); static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable); static void Ins_GetParamInsOrderType (void); static void Ins_ListInstitutionsForEdition (void); @@ -528,20 +529,15 @@ static void Ins_ListInstitutions (void) bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_); if (Gbl.Inss.Num) // There are institutions in the current country - { - if (ICanEdit) - Lay_PutFormToEdit (ActEdiIns); - Ins_ListInstitutionsForSeeing (); - } - else // No institutions created in the current country - { + Ins_ListInstitutionsForSeeing (ICanEdit); + else Lay_ShowAlert (Lay_INFO,Txt_No_institutions_have_been_created_in_this_country); - if (ICanEdit) - { - Act_FormStart (ActEdiIns); - Lay_PutConfirmButton (Txt_Create_institution); - Act_FormEnd (); - } + + if (ICanEdit) + { + Act_FormStart (ActEdiIns); + Lay_PutConfirmButton (Txt_Create_institution); + Act_FormEnd (); } } @@ -549,7 +545,7 @@ static void Ins_ListInstitutions (void) /*************** List the institutions of the current country ****************/ /*****************************************************************************/ -static void Ins_ListInstitutionsForSeeing (void) +static void Ins_ListInstitutionsForSeeing (bool ICanEdit) { extern const char *Txt_Institutions_of_COUNTRY_X; unsigned NumIns; @@ -557,7 +553,10 @@ static void Ins_ListInstitutionsForSeeing (void) /***** Table head *****/ sprintf (Gbl.Title,Txt_Institutions_of_COUNTRY_X, Gbl.CurrentCty.Cty.Name[Gbl.Prefs.Language]); - Lay_StartRoundFrameTable (NULL,2,Gbl.Title); + Lay_StartRoundFrame (NULL,Gbl.Title, + ICanEdit ? Ins_PutIconToEdit : + NULL); + fprintf (Gbl.F.Out,"
"); Ins_PutHeadInstitutionsForSeeing (true); // Order selectable /***** Write all the institutions and their nuber of users *****/ @@ -567,7 +566,8 @@ static void Ins_ListInstitutionsForSeeing (void) Ins_ListOneInstitutionForSeeing (&(Gbl.Inss.Lst[NumIns]),NumIns + 1); /***** Table end *****/ - Lay_EndRoundFrameTable (); + fprintf (Gbl.F.Out,"
"); + Lay_EndRoundFrame (); } /*****************************************************************************/ @@ -657,6 +657,17 @@ static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned Nu Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; } +/*****************************************************************************/ +/******************** Put link (form) to edit institutions *******************/ +/*****************************************************************************/ + +static void Ins_PutIconToEdit (void) + { + extern const char *Txt_Edit; + + Lay_PutContextualLink (ActEdiIns,NULL,"edit64x64.png",Txt_Edit,NULL); + } + /*****************************************************************************/ /**************** Write header with fields of an institution *****************/ /*****************************************************************************/