Version 15.146.3

This commit is contained in:
Antonio Cañas Vargas 2016-03-16 12:49:28 +01:00
parent f9919c76ed
commit afb0eea3b8
3 changed files with 34 additions and 21 deletions

View File

@ -129,13 +129,14 @@
/****************************** Public constants *****************************/ /****************************** 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 CSS_FILE "swad15.146.css"
#define JS_FILE "swad15.131.3.js" #define JS_FILE "swad15.131.3.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // 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.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.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. Version 15.146: Mar 16, 2016 Now frame rectangles can have icons at top.

View File

@ -501,7 +501,9 @@ void Cty_ListCountries2 (void)
const char *BgColor; const char *BgColor;
/***** Table head *****/ /***** 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,"<table class=\"CELLS_PAD_2\" style=\"margin:0 auto;\">" fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\" style=\"margin:0 auto;\">"
"<tr>"); "<tr>");
for (Order = Cty_ORDER_BY_COUNTRY; for (Order = Cty_ORDER_BY_COUNTRY;
@ -684,8 +686,7 @@ static void Cty_PutIconToEdit (void)
{ {
extern const char *Txt_Edit; 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);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -66,8 +66,9 @@ extern struct Globals Gbl;
static void Ins_Configuration (bool PrintView); static void Ins_Configuration (bool PrintView);
static void Ins_ListInstitutions (void); 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_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned NumIns);
static void Ins_PutIconToEdit (void);
static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable); static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable);
static void Ins_GetParamInsOrderType (void); static void Ins_GetParamInsOrderType (void);
static void Ins_ListInstitutionsForEdition (void); static void Ins_ListInstitutionsForEdition (void);
@ -528,20 +529,15 @@ static void Ins_ListInstitutions (void)
bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_); bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_);
if (Gbl.Inss.Num) // There are institutions in the current country if (Gbl.Inss.Num) // There are institutions in the current country
{ Ins_ListInstitutionsForSeeing (ICanEdit);
if (ICanEdit) else
Lay_PutFormToEdit (ActEdiIns);
Ins_ListInstitutionsForSeeing ();
}
else // No institutions created in the current country
{
Lay_ShowAlert (Lay_INFO,Txt_No_institutions_have_been_created_in_this_country); Lay_ShowAlert (Lay_INFO,Txt_No_institutions_have_been_created_in_this_country);
if (ICanEdit)
{ if (ICanEdit)
Act_FormStart (ActEdiIns); {
Lay_PutConfirmButton (Txt_Create_institution); Act_FormStart (ActEdiIns);
Act_FormEnd (); Lay_PutConfirmButton (Txt_Create_institution);
} Act_FormEnd ();
} }
} }
@ -549,7 +545,7 @@ static void Ins_ListInstitutions (void)
/*************** List the institutions of the current country ****************/ /*************** 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; extern const char *Txt_Institutions_of_COUNTRY_X;
unsigned NumIns; unsigned NumIns;
@ -557,7 +553,10 @@ static void Ins_ListInstitutionsForSeeing (void)
/***** Table head *****/ /***** Table head *****/
sprintf (Gbl.Title,Txt_Institutions_of_COUNTRY_X, sprintf (Gbl.Title,Txt_Institutions_of_COUNTRY_X,
Gbl.CurrentCty.Cty.Name[Gbl.Prefs.Language]); 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,"<table class=\"CELLS_PAD_2\" style=\"margin:0 auto;\">");
Ins_PutHeadInstitutionsForSeeing (true); // Order selectable Ins_PutHeadInstitutionsForSeeing (true); // Order selectable
/***** Write all the institutions and their nuber of users *****/ /***** 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); Ins_ListOneInstitutionForSeeing (&(Gbl.Inss.Lst[NumIns]),NumIns + 1);
/***** Table end *****/ /***** Table end *****/
Lay_EndRoundFrameTable (); fprintf (Gbl.F.Out,"</table>");
Lay_EndRoundFrame ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -657,6 +657,17 @@ static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned Nu
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; 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 *****************/ /**************** Write header with fields of an institution *****************/
/*****************************************************************************/ /*****************************************************************************/