diff --git a/swad_changelog.h b/swad_changelog.h index d037c08ed..99d96d678 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.108.3 (2015/04/03)" +#define Log_PLATFORM_VERSION "SWAD 14.108.4 (2015/04/04)" // 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 14.108.4: Apr 04, 2015 Changes in statistic about institutions. (184267 lines) Version 14.108.3: Apr 03, 2015 Fixed bug in statistic about institutions. (184144 lines) Version 14.108.2: Apr 03, 2015 Fixed bug in statistic about institutions. (184142 lines) Version 14.108.1: Apr 03, 2015 Fixed bug in statistic about institutions. (184137 lines) diff --git a/swad_statistic.c b/swad_statistic.c index d080df419..e5844c830 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -4516,11 +4516,12 @@ static void Sta_GetAndShowInstitutionsStats (void) static void Sta_GetAndShowInssOrderedByNumCtrs (void) { extern const char *The_ClassFormul[The_NUM_THEMES]; + extern const char *Txt_Institutions_by_number_of_centres; extern const char *Txt_Centres; char Query[1024]; /****** Institutions ordered by number of centres ******/ - Lay_StartRoundFrameTable10 ("100%",2,"Instituciones según número de centros"); // Need translation + Lay_StartRoundFrameTable10 ("100%",2,Txt_Institutions_by_number_of_centres); /***** Get institutions ordered by number of centres *****/ switch (Gbl.Scope.Current) @@ -4567,11 +4568,12 @@ static void Sta_GetAndShowInssOrderedByNumCtrs (void) static void Sta_GetAndShowInssOrderedByNumDegs (void) { extern const char *The_ClassFormul[The_NUM_THEMES]; + extern const char *Txt_Institutions_by_number_of_degrees; extern const char *Txt_Degrees; char Query[1024]; /****** Institutions ordered by number of centres ******/ - Lay_StartRoundFrameTable10 ("100%",2,"Instituciones según número de titulaciones"); // Need translation + Lay_StartRoundFrameTable10 ("100%",2,Txt_Institutions_by_number_of_degrees); /***** Get institutions ordered by number of degrees *****/ switch (Gbl.Scope.Current) @@ -4621,11 +4623,12 @@ static void Sta_GetAndShowInssOrderedByNumDegs (void) static void Sta_GetAndShowInssOrderedByNumCrss (void) { extern const char *The_ClassFormul[The_NUM_THEMES]; + extern const char *Txt_Institutions_by_number_of_courses; extern const char *Txt_Courses; char Query[1024]; /****** Institutions ordered by number of centres ******/ - Lay_StartRoundFrameTable10 ("100%",2,"Instituciones según número de asignaturas"); // Need translation + Lay_StartRoundFrameTable10 ("100%",2,Txt_Institutions_by_number_of_courses); /***** Get institutions ordered by number of courses *****/ switch (Gbl.Scope.Current) @@ -4678,11 +4681,12 @@ static void Sta_GetAndShowInssOrderedByNumCrss (void) static void Sta_GetAndShowInssOrderedByNumUsrsInCrss (void) { extern const char *The_ClassFormul[The_NUM_THEMES]; + extern const char *Txt_Institutions_by_number_of_users_in_courses; extern const char *Txt_Users; char Query[1024]; /****** Institutions ordered by number of centres ******/ - Lay_StartRoundFrameTable10 ("100%",2,"Instituciones según número de usuarios en asignaturas"); // Need translation + Lay_StartRoundFrameTable10 ("100%",2,Txt_Institutions_by_number_of_users_in_courses); /***** Get institutions ordered by number of users in courses *****/ switch (Gbl.Scope.Current) @@ -4739,11 +4743,12 @@ static void Sta_GetAndShowInssOrderedByNumUsrsInCrss (void) static void Sta_GetAndShowInssOrderedByNumUsrsWhoClaimToBelongToThem (void) { extern const char *The_ClassFormul[The_NUM_THEMES]; + extern const char *Txt_Institutions_by_number_of_users_who_claim_to_belong_to_them; extern const char *Txt_Users; char Query[1024]; /****** Institutions ordered by number of centres ******/ - Lay_StartRoundFrameTable10 ("100%",2,"Instituciones según número de usuarios que dicen pertenecer a ellas"); // Need translation + Lay_StartRoundFrameTable10 ("100%",2,Txt_Institutions_by_number_of_users_who_claim_to_belong_to_them); /***** Get institutions ordered by number of users who claim to belong to them *****/ switch (Gbl.Scope.Current) @@ -4796,12 +4801,16 @@ static void Sta_GetAndShowInss (const char *Query,const char *TxtFigure) MYSQL_ROW row; unsigned NumInss; unsigned NumIns; + unsigned NumOrder; + unsigned NumberLastRow; + unsigned NumberThisRow; struct Institution Ins; /***** Query database *****/ if ((NumInss = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get institutions"))) { fprintf (Gbl.F.Out,"" + "" "" "%s" "" @@ -4812,22 +4821,36 @@ static void Sta_GetAndShowInss (const char *Query,const char *TxtFigure) Txt_Institution, TxtFigure); - for (NumIns = 0; - NumIns < NumInss; + for (NumIns = 1, NumOrder = 1, NumberLastRow = 0; + NumIns <= NumInss; NumIns++) { /***** Get next institution *****/ row = mysql_fetch_row (mysql_res); - /***** Get data of this institution (row[0]) *****/ + /* Get data of this institution (row[0]) */ Ins.InsCod = Str_ConvertStrCodToLongCod (row[0]); if (!Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA)) Lay_ShowErrorAndExit ("Institution not found."); - /***** Write link to institution *****/ + /* Get statistic (row[1]) */ + if (sscanf (row[1],"%u",&NumberThisRow) != 1) + Lay_ShowErrorAndExit ("Error in statistic"); + + /***** Number of order *****/ + if (NumberThisRow != NumberLastRow) + NumOrder = NumIns; fprintf (Gbl.F.Out,"" - "", + "" + "%u" + "", + NumOrder); + + /***** Write link to institution *****/ + fprintf (Gbl.F.Out,"", The_ClassFormul[Gbl.Prefs.Theme]); + + /* Icon and name of this institution */ Act_FormStart (ActSeeInsInf); Ins_PutParamInsCod (Ins.InsCod); Act_LinkFormSubmit (Ins.ShortName,The_ClassFormul[Gbl.Prefs.Theme]); @@ -4835,13 +4858,17 @@ static void Sta_GetAndShowInss (const char *Query,const char *TxtFigure) 32,NULL,true); fprintf (Gbl.F.Out," %s",Ins.FullName); Act_FormEnd (); + fprintf (Gbl.F.Out,""); - /***** Write number of centres (row[1]) *****/ + /***** Write statistic *****/ fprintf (Gbl.F.Out,"" - "%s" - "", - row[1]); + "%u" + "" + "", + NumberThisRow); + + NumberLastRow = NumberThisRow; } } diff --git a/swad_text.c b/swad_text.c index 6e212a1e8..d044b66ed 100644 --- a/swad_text.c +++ b/swad_text.c @@ -14558,6 +14558,111 @@ const char *Txt_INSTITUTIONS_HELP_ORDER[2] = #endif }; +const char *Txt_Institutions_by_number_of_centres = +#if L==0 + "Institucions segons nombre de centres"; +#elif L==1 + "Hochschulen nach der Anzahl der Lehrinstitute"; +#elif L==2 + "Institutions by number of centres"; +#elif L==3 + "Instituciones según número de centros"; +#elif L==4 + "Établissements par nombre de centres"; +#elif L==5 + "Instituciones según número de centros"; // Okoteve traducción +#elif L==6 + "Istituzioni per numero di centri"; +#elif L==7 + "Instytucje według liczby ośrodków"; +#elif L==8 + "Instituções por número de centros"; +#endif + +const char *Txt_Institutions_by_number_of_degrees = +#if L==0 + "Institucions segons nombre de titulacions"; +#elif L==1 + "Hochschulen nach der Anzahl der Studiengang"; +#elif L==2 + "Institutions by number of degrees"; +#elif L==3 + "Instituciones según número de titulaciones"; +#elif L==4 + "Établissements par nombre d'études"; +#elif L==5 + "Instituciones según número de titulaciones"; // Okoteve traducción +#elif L==6 + "Istituzioni per numero di lauree"; +#elif L==7 + "Instytucje według liczby stopni"; +#elif L==8 + "Instituções por número de titulações"; +#endif + +const char *Txt_Institutions_by_number_of_courses = +#if L==0 + "Institucions segons nombre de assignatures"; +#elif L==1 + "Hochschulen nach der Anzahl der Kursen"; +#elif L==2 + "Institutions by number of courses"; +#elif L==3 + "Instituciones según número de asignaturas"; +#elif L==4 + "Établissements par nombre de matières"; +#elif L==5 + "Instituciones según número de asignaturas"; // Okoteve traducción +#elif L==6 + "Istituzioni per numero di corsi"; +#elif L==7 + "Instytucje według liczby kursõw"; +#elif L==8 + "Instituções por número de disciplinas"; +#endif + +const char *Txt_Institutions_by_number_of_users_in_courses = +#if L==0 + "Institucions segons nombre d'usuaris en assignatures"; +#elif L==1 + "Hochschulen nach der Anzahl der Benutzer in Kurse"; +#elif L==2 + "Institutions by number of users in courses"; +#elif L==3 + "Instituciones según número de usuarios en asignaturas"; +#elif L==4 + "Établissements par nombre d'utilisateurs dans matières"; +#elif L==5 + "Instituciones según número de usuarios en asignaturas"; // Okoteve traducción +#elif L==6 + "Istituzioni per numero di utenti in corsi"; +#elif L==7 + "Instytucje według liczby użytkowników w kursõw"; +#elif L==8 + "Instituções por número de usuários em disciplinas"; +#endif + +const char *Txt_Institutions_by_number_of_users_who_claim_to_belong_to_them = +#if L==0 + "Institucions segons nombre d'usuaris que diuen pertànyer-hi"; +#elif L==1 + "Hochschulen nach der Anzahl der Benutzer, die behaupten, zu ihnen gehören"; +#elif L==2 + "Institutions by number of users who claim to belong to them"; +#elif L==3 + "Instituciones según número de usuarios que dicen pertenecer a ellas"; +#elif L==4 + "Établissements par nombre d'utilisateurs qui prétendent leur appartiennent"; +#elif L==5 + "Instituciones según número de usuarios que dicen pertenecer a ellas"; // Okoteve traducción +#elif L==6 + "Istituzioni per numero di utenti che affermano di appartenere a loro"; +#elif L==7 + "Instytucje według liczby użytkowników, którzy twierdzą, że należą do nich"; +#elif L==8 + "Instituções por número de usuários que afirmam pertencer a elas"; +#endif + const char *Txt_Institutions_of_COUNTRY_X = // Warning: it is very important to include %s in the following sentences #if L==0 "Institucions de %s"; @@ -18011,9 +18116,9 @@ const char *Txt_MENU_SUBTITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] = #if L==0 "Institutions, centres, titulacions i assignatures pendents d'activar" #elif L==1 - "Hochschulen, Lehrinstitute, Studiengang und anhängig Kursen" + "Anhängig Hochschulen, Lehrinstitute, Studiengang und Kursen" #elif L==2 - "Institutions, centres, degrees and pending courses" + "Pending institutions, centres, degrees and courses" #elif L==3 "Instituciones, centros, titulaciones y asignaturas pendientes de activar" #elif L==4