diff --git a/swad_centre.c b/swad_centre.c
index 42ddf972..d67296ad 100644
--- a/swad_centre.c
+++ b/swad_centre.c
@@ -73,8 +73,8 @@ static void Ctr_Configuration (bool PrintView);
static void Ctr_ListCentres (void);
static void Ctr_ListCentresForSeeing (bool ICanEdit);
-static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr);
static void Ctr_PutIconToEdit (void);
+static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr);
static void Ctr_GetParamCtrOrderType (void);
static void Ctr_GetPhotoAttribution (long CtrCod,char **PhotoAttribution);
static void Ctr_FreePhotoAttribution (char **PhotoAttribution);
@@ -591,6 +591,7 @@ void Ctr_ShowCtrsOfCurrentIns (void)
static void Ctr_ListCentres (void)
{
extern const char *Txt_No_centres_have_been_created_in_this_institution;
+ extern const char *Txt_Create_another_centre;
extern const char *Txt_Create_centre;
bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_);
@@ -602,7 +603,8 @@ static void Ctr_ListCentres (void)
if (ICanEdit)
{
Act_FormStart (ActEdiCtr);
- Lay_PutConfirmButton (Txt_Create_centre);
+ Lay_PutConfirmButton (Gbl.Ctrs.Num ? Txt_Create_another_centre :
+ Txt_Create_centre);
Act_FormEnd ();
}
}
@@ -636,6 +638,17 @@ static void Ctr_ListCentresForSeeing (bool ICanEdit)
Lay_EndRoundFrame ();
}
+/*****************************************************************************/
+/********************** 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);
+ }
+
/*****************************************************************************/
/************************* List one centre for seeing ************************/
/*****************************************************************************/
@@ -727,17 +740,6 @@ 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 2def7e8f..bb10c493 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -129,13 +129,15 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 15.146.5 (2016-03-16)"
+#define Log_PLATFORM_VERSION "SWAD 15.147 (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.147: Mar 16, 2016 New buttons to create another institution / centre / degree / course. (195903 lines)
+ Version 15.146.6: Mar 16, 2016 Icons to edit courses integrated in frame. (195814 lines)
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)
diff --git a/swad_course.c b/swad_course.c
index 3d18163a..417b8019 100644
--- a/swad_course.c
+++ b/swad_course.c
@@ -80,7 +80,8 @@ static void Crs_WriteListMyCoursesToSelectOne (void);
static void Crs_GetListCoursesInDegree (Crs_WhatCourses_t WhatCourses);
static void Crs_ListCourses (void);
static void Crs_EditCourses (void);
-static void Crs_ListCoursesForSeeing (void);
+static void Crs_ListCoursesForSeeing (bool ICanEdit);
+static void Crs_PutIconToEdit (void);
static bool Crs_ListCoursesOfAYearForSeeing (unsigned Year);
static void Crs_ListCoursesForEdition (void);
static bool Crs_CheckIfICanEdit (struct Course *Crs);
@@ -1105,24 +1106,21 @@ void Crs_WriteSelectorMyCourses (void)
static void Crs_ListCourses (void)
{
extern const char *Txt_No_courses_have_been_created_in_this_degree;
+ extern const char *Txt_Create_another_course;
extern const char *Txt_Create_course;
bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_);
if (Gbl.CurrentDeg.Deg.NumCrss) // There are courses in the current degree
- {
- if (ICanEdit)
- Lay_PutFormToEdit (ActEdiCrs);
- Crs_ListCoursesForSeeing ();
- }
+ Crs_ListCoursesForSeeing (ICanEdit);
else // No courses created in the current degree
- {
Lay_ShowAlert (Lay_INFO,Txt_No_courses_have_been_created_in_this_degree);
- if (ICanEdit)
- {
- Act_FormStart (ActEdiCrs);
- Lay_PutConfirmButton (Txt_Create_course);
- Act_FormEnd ();
- }
+
+ if (ICanEdit)
+ {
+ Act_FormStart (ActEdiCrs);
+ Lay_PutConfirmButton (Gbl.CurrentDeg.Deg.NumCrss ? Txt_Create_another_course :
+ Txt_Create_course);
+ Act_FormEnd ();
}
}
@@ -1148,15 +1146,18 @@ static void Crs_EditCourses (void)
/********************** List current courses for seeing **********************/
/*****************************************************************************/
-static void Crs_ListCoursesForSeeing (void)
+static void Crs_ListCoursesForSeeing (bool ICanEdit)
{
extern const char *Txt_Courses_of_DEGREE_X;
unsigned Year;
/***** Write heading *****/
- sprintf (Gbl.Message,Txt_Courses_of_DEGREE_X,
+ sprintf (Gbl.Title,Txt_Courses_of_DEGREE_X,
Gbl.CurrentDeg.Deg.ShortName);
- Lay_StartRoundFrameTable (NULL,2,Gbl.Message);
+ Lay_StartRoundFrame (NULL,Gbl.Title,
+ ICanEdit ? Crs_PutIconToEdit :
+ NULL);
+ fprintf (Gbl.F.Out,"
");
Crs_PutHeadCoursesForSeeing ();
/***** List the courses *****/
@@ -1168,7 +1169,19 @@ static void Crs_ListCoursesForSeeing (void)
Crs_ListCoursesOfAYearForSeeing (0); // Courses without a year selected
/***** Table end *****/
- Lay_EndRoundFrameTable ();
+ fprintf (Gbl.F.Out,"
");
+ Lay_EndRoundFrame ();
+ }
+
+/*****************************************************************************/
+/********************** Put link (form) to edit courses **********************/
+/*****************************************************************************/
+
+static void Crs_PutIconToEdit (void)
+ {
+ extern const char *Txt_Edit;
+
+ Lay_PutContextualLink (ActEdiCrs,NULL,"edit64x64.png",Txt_Edit,NULL);
}
/*****************************************************************************/
diff --git a/swad_degree.c b/swad_degree.c
index ea753001..69c8acac 100644
--- a/swad_degree.c
+++ b/swad_degree.c
@@ -92,6 +92,7 @@ static void Deg_EditDegreeTypes (void);
static void Deg_ListDegreeTypesForSeeing (void);
static void Deg_ListDegreeTypesForEdition (void);
static void Deg_ListDegreesForSeeing (bool ICanEdit);
+static void Deg_PutIconToEdit (void);
static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg);
static void Deg_ListDegreesForEdition (void);
static bool Deg_CheckIfICanEdit (struct Degree *Deg);
@@ -101,7 +102,6 @@ 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);
@@ -1292,6 +1292,17 @@ static void Deg_ListDegreesForSeeing (bool ICanEdit)
Lay_EndRoundFrame ();
}
+/*****************************************************************************/
+/********************** Put link (form) to edit degrees **********************/
+/*****************************************************************************/
+
+static void Deg_PutIconToEdit (void)
+ {
+ extern const char *Txt_Edit;
+
+ Lay_PutContextualLink (ActEdiDeg,NULL,"edit64x64.png",Txt_Edit,NULL);
+ }
+
/*****************************************************************************/
/************************ List one degree for seeing *************************/
/*****************************************************************************/
@@ -1876,17 +1887,6 @@ 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 *******************/
/*****************************************************************************/
@@ -2049,6 +2049,7 @@ static void Deg_CreateDegree (struct Degree *Deg,unsigned Status)
static void Deg_ListDegrees (void)
{
extern const char *Txt_No_degrees_have_been_created_in_this_centre;
+ extern const char *Txt_Create_another_degree;
extern const char *Txt_Create_degree;
bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_);
@@ -2060,7 +2061,8 @@ static void Deg_ListDegrees (void)
if (ICanEdit)
{
Act_FormStart (ActEdiDeg);
- Lay_PutConfirmButton (Txt_Create_degree);
+ Lay_PutConfirmButton (Gbl.CurrentCtr.Ctr.NumDegs ? Txt_Create_another_degree :
+ Txt_Create_degree);
Act_FormEnd ();
}
}
diff --git a/swad_institution.c b/swad_institution.c
index 7fac4684..d26669cb 100644
--- a/swad_institution.c
+++ b/swad_institution.c
@@ -67,8 +67,8 @@ static void Ins_Configuration (bool PrintView);
static void Ins_ListInstitutions (void);
static void Ins_ListInstitutionsForSeeing (bool ICanEdit);
-static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned NumIns);
static void Ins_PutIconToEdit (void);
+static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned NumIns);
static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable);
static void Ins_GetParamInsOrderType (void);
static void Ins_ListInstitutionsForEdition (void);
@@ -525,6 +525,7 @@ void Ins_ShowInssOfCurrentCty (void)
static void Ins_ListInstitutions (void)
{
extern const char *Txt_No_institutions_have_been_created_in_this_country;
+ extern const char *Txt_Create_another_institution;
extern const char *Txt_Create_institution;
bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_);
@@ -536,7 +537,8 @@ static void Ins_ListInstitutions (void)
if (ICanEdit)
{
Act_FormStart (ActEdiIns);
- Lay_PutConfirmButton (Txt_Create_institution);
+ Lay_PutConfirmButton (Gbl.Inss.Num ? Txt_Create_another_institution :
+ Txt_Create_institution);
Act_FormEnd ();
}
}
@@ -570,6 +572,17 @@ static void Ins_ListInstitutionsForSeeing (bool ICanEdit)
Lay_EndRoundFrame ();
}
+/*****************************************************************************/
+/******************** 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);
+ }
+
/*****************************************************************************/
/********************** List one institution for seeing **********************/
/*****************************************************************************/
@@ -657,17 +670,6 @@ 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 *****************/
/*****************************************************************************/
diff --git a/swad_text.c b/swad_text.c
index 769c9a5f..26d7ca6a 100644
--- a/swad_text.c
+++ b/swad_text.c
@@ -5727,6 +5727,90 @@ const char *Txt_Create_announcement =
"Criar anúncio";
#endif
+const char *Txt_Create_another_centre =
+#if L==1
+ "Crear un altre centre";
+#elif L==2
+ "Erstellen Sie ein anderes Lehrinstitut";
+#elif L==3
+ "Create another centre";
+#elif L==4
+ "Crear otro centro";
+#elif L==5
+ "Créer un autre centre";
+#elif L==6
+ "Crear otro centro"; // Okoteve traducción
+#elif L==7
+ "Crea un altro centro";
+#elif L==8
+ "Tworzenie inny centrum";
+#elif L==9
+ "Criar um outro centro";
+#endif
+
+const char *Txt_Create_another_course =
+#if L==1
+ "Crear una altra assignatura";
+#elif L==2
+ "Erstellen Sie ein anderes Kurs";
+#elif L==3
+ "Create another course";
+#elif L==4
+ "Crear otra asignatura";
+#elif L==5
+ "Créer une autre matière";
+#elif L==6
+ "Crear otra asignatura"; // Okoteve traducción
+#elif L==7
+ "Crea un altro corso";
+#elif L==8
+ "Tworzenie inny kursu";
+#elif L==9
+ "Criar uma outra disciplina";
+#endif
+
+const char *Txt_Create_another_degree =
+#if L==1
+ "Crear una altra titulació";
+#elif L==2
+ "Erstellen Sie ein anderes Studiengang";
+#elif L==3
+ "Create another degree";
+#elif L==4
+ "Crear otra titulación";
+#elif L==5
+ "Créer un autre étude";
+#elif L==6
+ "Crear otra titulación"; // Okoteve traducción
+#elif L==7
+ "Crea una altra laurea";
+#elif L==8
+ "Tworzenie inny stopnia";
+#elif L==9
+ "Criar uma outra titulação";
+#endif
+
+const char *Txt_Create_another_institution =
+#if L==1
+ "Crear una altra institució";
+#elif L==2
+ "Erstellen Sie ein anderes Hochschule";
+#elif L==3
+ "Create another institution";
+#elif L==4
+ "Crear otra institución";
+#elif L==5
+ "Créer un autre établissement";
+#elif L==6
+ "Crear otra institución"; // Okoteve traducción
+#elif L==7
+ "Crea una altra istituzione";
+#elif L==8
+ "Tworzenie inny instytucji";
+#elif L==9
+ "Criar uma outra institução";
+#endif
+
const char *Txt_Create_assignment =
#if L==1
"Crear actividad"; // Necessita traduccio
@@ -5771,7 +5855,7 @@ const char *Txt_Create_banner =
const char *Txt_Create_centre =
#if L==1
- "Crear centro"; // Necessita traduccio
+ "Crear centre";
#elif L==2
"Lehrinstitut eingeben";
#elif L==3
@@ -5813,7 +5897,7 @@ const char *Txt_Create_country =
const char *Txt_Create_course =
#if L==1
- "Crear asignatura"; // Necessita traduccio
+ "Crear assignatura";
#elif L==2
"Kurs eingeben";
#elif L==3
@@ -5834,7 +5918,7 @@ const char *Txt_Create_course =
const char *Txt_Create_degree =
#if L==1
- "Crear titulación"; // Necessita traduccio
+ "Crear titulació";
#elif L==2
"Studiengang eingeben";
#elif L==3
@@ -5981,7 +6065,7 @@ const char *Txt_Create_holiday =
const char *Txt_Create_institution =
#if L==1
- "Crear institución"; // Necessita traduccio
+ "Crear institució";
#elif L==2
"Hochschule eingeben";
#elif L==3