diff --git a/swad_changelog.h b/swad_changelog.h index 1991c1064..98a5d7ba7 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -492,7 +492,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.109.2 (2020-01-02)" +#define Log_PLATFORM_VERSION "SWAD 19.109.3 (2020-01-02)" #define CSS_FILE "swad19.101.5.css" #define JS_FILE "swad19.91.1.js" /* @@ -502,6 +502,7 @@ ps2pdf source.ps destination.pdf // TODO: Version 19.1xx: Jan xx, 2020 Map in country information. (? lines) // TODO: Version 19.1xx: Jan xx, 2020 Map in institution information. (? lines) + Version 19.109.3: Jan 02, 2020 Changing action descriptions from database to swad-core. Not finished. (278839 lines) Version 19.109.2: Jan 02, 2020 Changing action descriptions from database to swad-core. Not finished. (278623 lines) Version 19.109.1: Jan 01, 2020 Changing action descriptions from database to swad-core. Not finished. (278680 lines) Version 19.109: Jan 01, 2020 Changing action descriptions from database to swad-core. Not finished. (278686 lines) diff --git a/swad_country.c b/swad_country.c index 9d8d48be6..073f8b509 100644 --- a/swad_country.c +++ b/swad_country.c @@ -966,6 +966,7 @@ void Cty_WriteSelectorOfCountry (void) void Cty_WriteCountryName (long CtyCod,const char *ClassLink) { + extern const char *Txt_Actions[Act_NUM_ACTIONS]; char CtyName[Cty_MAX_BYTES_NAME + 1]; char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1]; bool PutForm = ClassLink && @@ -980,8 +981,16 @@ void Cty_WriteCountryName (long CtyCod,const char *ClassLink) /***** Write country name with link to country information *****/ Frm_StartForm (ActSeeCtyInf); Cty_PutParamCtyCod (CtyCod); - HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtyInf),ActTxt), - ClassLink,NULL); + if (Txt_Actions[ActSeeCtyInf]) + { + if (Txt_Actions[ActSeeCtyInf][0]) + HTM_BUTTON_SUBMIT_Begin (Txt_Actions[ActSeeCtyInf],ClassLink,NULL); + else + HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtyInf),ActTxt), + ClassLink,NULL); + } + else + HTM_BUTTON_SUBMIT_Begin ("?",ClassLink,NULL); HTM_Txt (CtyName); HTM_BUTTON_End (); Frm_EndForm (); diff --git a/swad_course.c b/swad_course.c index 25b1ac145..76e5716de 100644 --- a/swad_course.c +++ b/swad_course.c @@ -143,6 +143,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void) extern const char *The_ClassFormLinkInBoxBold[The_NUM_THEMES]; extern const char *Txt_My_courses; extern const char *Txt_System; + extern const char *Txt_Actions[Act_NUM_ACTIONS]; struct Country Cty; struct Instit Ins; struct Centre Ctr; @@ -219,10 +220,24 @@ static void Crs_WriteListMyCoursesToSelectOne (void) Lay_IndentDependingOnLevel (1,IsLastItemInLevel); Frm_StartForm (ActMyCrs); Cty_PutParamCtyCod (Cty.CtyCod); - HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtyInf),ActTxt), - Highlight ? ClassHighlight : - ClassNormal, - NULL); + if (Txt_Actions[ActSeeCtyInf]) + { + if (Txt_Actions[ActSeeCtyInf][0]) + HTM_BUTTON_SUBMIT_Begin (Txt_Actions[ActSeeCtyInf], + Highlight ? ClassHighlight : + ClassNormal, + NULL); + else + HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtyInf),ActTxt), + Highlight ? ClassHighlight : + ClassNormal, + NULL); + } + else + HTM_BUTTON_SUBMIT_Begin ("?", + Highlight ? ClassHighlight : + ClassNormal, + NULL); Cty_DrawCountryMap (&Cty,"ICO16x16"); HTM_TxtF (" %s",Cty.Name[Gbl.Prefs.Language]); HTM_BUTTON_End (); @@ -253,10 +268,24 @@ static void Crs_WriteListMyCoursesToSelectOne (void) Lay_IndentDependingOnLevel (2,IsLastItemInLevel); Frm_StartForm (ActMyCrs); Ins_PutParamInsCod (Ins.InsCod); - HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeInsInf),ActTxt), - Highlight ? ClassHighlight : - ClassNormal, - NULL); + if (Txt_Actions[ActSeeInsInf]) + { + if (Txt_Actions[ActSeeInsInf][0]) + HTM_BUTTON_SUBMIT_Begin (Txt_Actions[ActSeeInsInf], + Highlight ? ClassHighlight : + ClassNormal, + NULL); + else + HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeInsInf),ActTxt), + Highlight ? ClassHighlight : + ClassNormal, + NULL); + } + else + HTM_BUTTON_SUBMIT_Begin ("?", + Highlight ? ClassHighlight : + ClassNormal, + NULL); Lgo_DrawLogo (Hie_INS,Ins.InsCod,Ins.ShrtName,16,NULL,true); HTM_TxtF (" %s",Ins.ShrtName); HTM_BUTTON_End (); @@ -287,10 +316,24 @@ static void Crs_WriteListMyCoursesToSelectOne (void) Lay_IndentDependingOnLevel (3,IsLastItemInLevel); Frm_StartForm (ActMyCrs); Ctr_PutParamCtrCod (Ctr.CtrCod); - HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtrInf),ActTxt), - Highlight ? ClassHighlight : - ClassNormal, - NULL); + if (Txt_Actions[ActSeeCtrInf]) + { + if (Txt_Actions[ActSeeCtrInf][0]) + HTM_BUTTON_SUBMIT_Begin (Txt_Actions[ActSeeCtrInf], + Highlight ? ClassHighlight : + ClassNormal, + NULL); + else + HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtrInf),ActTxt), + Highlight ? ClassHighlight : + ClassNormal, + NULL); + } + else + HTM_BUTTON_SUBMIT_Begin ("?", + Highlight ? ClassHighlight : + ClassNormal, + NULL); Lgo_DrawLogo (Hie_CTR,Ctr.CtrCod,Ctr.ShrtName,16,NULL,true); HTM_TxtF (" %s",Ctr.ShrtName); HTM_BUTTON_End (); @@ -321,10 +364,24 @@ static void Crs_WriteListMyCoursesToSelectOne (void) Lay_IndentDependingOnLevel (4,IsLastItemInLevel); Frm_StartForm (ActMyCrs); Deg_PutParamDegCod (Deg.DegCod); - HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeDegInf),ActTxt), - Highlight ? ClassHighlight : - ClassNormal, - NULL); + if (Txt_Actions[ActSeeDegInf]) + { + if (Txt_Actions[ActSeeDegInf][0]) + HTM_BUTTON_SUBMIT_Begin (Txt_Actions[ActSeeDegInf], + Highlight ? ClassHighlight : + ClassNormal, + NULL); + else + HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeDegInf),ActTxt), + Highlight ? ClassHighlight : + ClassNormal, + NULL); + } + else + HTM_BUTTON_SUBMIT_Begin ("?", + Highlight ? ClassHighlight : + ClassNormal, + NULL); Lgo_DrawLogo (Hie_DEG,Deg.DegCod,Deg.ShrtName,16,NULL,true); HTM_TxtF (" %s",Deg.ShrtName); HTM_BUTTON_End (); diff --git a/swad_forum.c b/swad_forum.c index 9e7548826..8436bf1af 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -2014,6 +2014,7 @@ static void For_WriteLinkToForum (struct Forum *Forum, extern const char *The_ClassFormLinkInBox[The_NUM_THEMES]; extern const char *The_ClassFormLinkInBoxBold[The_NUM_THEMES]; extern const char *Txt_Copy_not_allowed; + extern const char *Txt_Actions[Act_NUM_ACTIONS]; unsigned NumThrs; unsigned NumThrsWithNewPosts; char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1]; @@ -2065,8 +2066,18 @@ static void For_WriteLinkToForum (struct Forum *Forum, Forum->Location, -1L, -1L); - HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (For_ActionsSeeFor[Forum->Type]),ActTxt), - Class,NULL); + + if (Txt_Actions[For_ActionsSeeFor[Forum->Type]]) + { + if (Txt_Actions[For_ActionsSeeFor[Forum->Type]][0]) + HTM_BUTTON_SUBMIT_Begin (Txt_Actions[For_ActionsSeeFor[Forum->Type]], + Class,NULL); + else + HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (For_ActionsSeeFor[Forum->Type]),ActTxt), + Class,NULL); + } + else + HTM_BUTTON_SUBMIT_Begin ("?",Class,NULL); For_SetForumName (Forum,ForumName,Gbl.Prefs.Language,true); switch (Forum->Type) { diff --git a/swad_log.c b/swad_log.c index c246b4c57..08c13d54a 100644 --- a/swad_log.c +++ b/swad_log.c @@ -354,4 +354,3 @@ void Log_GetAndShowLastClicks (void) /***** Free structure that stores the query result *****/ mysql_free_result (mysql_res); } - diff --git a/swad_report.c b/swad_report.c index 4513061b9..9ecbea139 100644 --- a/swad_report.c +++ b/swad_report.c @@ -767,6 +767,7 @@ static void Rep_WriteSectionHitsPerAction (struct Rep_Report *Report) extern Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD]; extern const char *Txt_Hits_per_action; extern const char *Txt_TABS_TXT[Tab_NUM_TABS]; + extern const char *Txt_Actions[Act_NUM_ACTIONS]; extern const char *Txt_Other_actions; MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -820,14 +821,22 @@ static void Rep_WriteSectionHitsPerAction (struct Rep_Report *Report) fprintf (Gbl.F.Rep," "); if (ActCod >= 0) { - Action = Act_FromActCodToAction[ActCod]; - if (Action >= 0) + if ((Action = Act_FromActCodToAction[ActCod]) >= 0) { Tab = Act_GetTab (Act_GetSuperAction (Action)); if (Txt_TABS_TXT[Tab]) fprintf (Gbl.F.Rep,"%s > ",Txt_TABS_TXT[Tab]); } - fprintf (Gbl.F.Rep,"%s",Act_GetActionTextFromDB (ActCod,ActTxt)); + + if (Txt_Actions[Action]) + { + if (Txt_Actions[Action][0]) + fprintf (Gbl.F.Rep,"%s",Txt_Actions[Action]); + else + fprintf (Gbl.F.Rep,"%s",Act_GetActionTextFromDB (ActCod,ActTxt)); + } + else + fprintf (Gbl.F.Rep,"?"); } else fprintf (Gbl.F.Rep,"?"); diff --git a/swad_statistic.c b/swad_statistic.c index a5da59421..058d9af4b 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -590,6 +590,7 @@ static void Sta_WriteSelectorAction (void) extern const char *Txt_Action; extern const char *Txt_Any_action; extern const char *Txt_TABS_TXT[Tab_NUM_TABS]; + extern const char *Txt_Actions[Act_NUM_ACTIONS]; Act_Action_t Action; unsigned ActionUnsigned; Tab_Tab_t Tab; @@ -611,12 +612,27 @@ static void Sta_WriteSelectorAction (void) Action++) { Tab = Act_GetTab (Act_GetSuperAction (Action)); - Act_GetActionTextFromDB (Act_GetActCod (Action),ActTxt); - ActionUnsigned = (unsigned) Action; - HTM_OPTION (HTM_Type_UNSIGNED,&ActionUnsigned, - Action == Gbl.Stat.NumAction,false, - "%u: %s > %s",(unsigned) Action,Txt_TABS_TXT[Tab],ActTxt); + + if (Txt_Actions[Action]) + { + if (Txt_Actions[Action][0]) + HTM_OPTION (HTM_Type_UNSIGNED,&ActionUnsigned, + Action == Gbl.Stat.NumAction,false, + "%u: %s > %s", + (unsigned) Action,Txt_TABS_TXT[Tab],Txt_Actions[Action]); + else + HTM_OPTION (HTM_Type_UNSIGNED,&ActionUnsigned, + Action == Gbl.Stat.NumAction,false, + "%u: %s > %s", + (unsigned) Action,Txt_TABS_TXT[Tab], + Act_GetActionTextFromDB (Act_GetActCod (Action),ActTxt)); + } + else + HTM_OPTION (HTM_Type_UNSIGNED,&ActionUnsigned, + Action == Gbl.Stat.NumAction,false, + "%u: %s > %s", + (unsigned) Action,Txt_TABS_TXT[Tab],"?????????????"); } HTM_SELECT_End (); HTM_TD_End (); @@ -1409,6 +1425,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse) static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql_res) { + extern Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD]; extern const char *Txt_Show_previous_X_clicks; extern const char *Txt_PAGES_Previous; extern const char *Txt_Clicks; @@ -1424,6 +1441,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql extern const char *Txt_Action; extern const char *Txt_LOG_More_info; extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; + extern const char *Txt_Actions[Act_NUM_ACTIONS]; unsigned long NumRow; unsigned long FirstRow; // First row to show unsigned long LastRow; // Last rows to show @@ -1437,6 +1455,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql unsigned UniqueId; char *Id; long ActCod; + Act_Action_t Action; char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1]; /***** Initialize estructura of data of the user *****/ @@ -1619,16 +1638,26 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql /* Write the action */ if (sscanf (row[4],"%ld",&ActCod) != 1) Lay_ShowErrorAndExit ("Wrong action code."); + HTM_TD_Begin ("class=\"LOG LT COLOR%u\"",Gbl.RowEvenOdd); if (ActCod >= 0) { - HTM_TD_Begin ("class=\"LOG LT COLOR%u\"",Gbl.RowEvenOdd); - HTM_TxtF ("%s ",Act_GetActionTextFromDB (ActCod,ActTxt)); + if ((Action = Act_FromActCodToAction[ActCod]) >= 0) + { + if (Txt_Actions[Action]) + { + if (Txt_Actions[Action][0]) + HTM_TxtF ("%s ",Txt_Actions[Action]); + else + HTM_TxtF ("%s ",Act_GetActionTextFromDB (ActCod,ActTxt)); + } + else + HTM_TxtF ("? "); + } + else + HTM_TxtF ("? "); } else - { - HTM_TD_Begin ("class=\"LOG LT COLOR%u\"",Gbl.RowEvenOdd); HTM_TxtF ("? "); - } HTM_TD_End (); /* Write the comments of the access */ @@ -2989,12 +3018,15 @@ static void Sta_WriteAccessMinute (unsigned Minute,double HitsNum,double MaxX) static void Sta_ShowNumHitsPerAction (unsigned long NumRows, MYSQL_RES *mysql_res) { + extern Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD]; extern const char *Txt_Action; extern const char *Txt_STAT_TYPE_COUNT_CAPS[Sta_NUM_COUNT_TYPES]; + extern const char *Txt_Actions[Act_NUM_ACTIONS]; unsigned long NumRow; struct Sta_Hits Hits; MYSQL_ROW row; long ActCod; + Act_Action_t Action; char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1]; /***** Write heading *****/ @@ -3023,7 +3055,22 @@ static void Sta_ShowNumHitsPerAction (unsigned long NumRows, HTM_TD_Begin ("class=\"LOG RT\""); if (ActCod >= 0) - HTM_TxtF ("%s ",Act_GetActionTextFromDB (ActCod,ActTxt)); + { + if ((Action = Act_FromActCodToAction[ActCod]) >= 0) + { + if (Txt_Actions[Action]) + { + if (Txt_Actions[Action][0]) + HTM_TxtF ("%s ",Txt_Actions[Action]); + else + HTM_TxtF ("%s ",Act_GetActionTextFromDB (ActCod,ActTxt)); + } + else + HTM_Txt ("? "); + } + else + HTM_Txt ("? "); + } else HTM_Txt ("? "); HTM_TD_End (); diff --git a/swad_text_action.c b/swad_text_action.c index adc3231d9..32091fb45 100644 --- a/swad_text_action.c +++ b/swad_text_action.c @@ -2811,6 +2811,27 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "" // Potrzebujesz tlumaczenie #elif L==9 // pt "" // Precisa de tradução +#endif + , + [ActRecInsLog] = +#if L==1 // ca + "" // Necessita traducció +#elif L==2 // de + "" // Need Übersetzung +#elif L==3 // en + "" +#elif L==4 // es + "" +#elif L==5 // fr + "" // Besoin de traduction +#elif L==6 // gn + "" // Okoteve traducción +#elif L==7 // it + "" // Bisogno di traduzione +#elif L==8 // pl + "" // Potrzebujesz tlumaczenie +#elif L==9 // pt + "" // Precisa de tradução #endif , [ActRemInsLog] = @@ -3714,6 +3735,27 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "" // Potrzebujesz tlumaczenie #elif L==9 // pt "" // Precisa de tradução +#endif + , + [ActRecCtrLog] = +#if L==1 // ca + "" // Necessita traducció +#elif L==2 // de + "" // Need Übersetzung +#elif L==3 // en + "" +#elif L==4 // es + "" +#elif L==5 // fr + "" // Besoin de traduction +#elif L==6 // gn + "" // Okoteve traducción +#elif L==7 // it + "" // Bisogno di traduzione +#elif L==8 // pl + "" // Potrzebujesz tlumaczenie +#elif L==9 // pt + "" // Precisa de tradução #endif , [ActRemCtrLog] = @@ -25197,6 +25239,48 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "" // Potrzebujesz tlumaczenie #elif L==9 // pt "" // Precisa de tradução +#endif + , + [ActReqDelThrDegUsr] = +#if L==1 // ca + "" // Necessita traducció +#elif L==2 // de + "" // Need Übersetzung +#elif L==3 // en + "" +#elif L==4 // es + "" +#elif L==5 // fr + "" // Besoin de traduction +#elif L==6 // gn + "" // Okoteve traducción +#elif L==7 // it + "" // Bisogno di traduzione +#elif L==8 // pl + "" // Potrzebujesz tlumaczenie +#elif L==9 // pt + "" // Precisa de tradução +#endif + , + [ActReqDelThrDegTch] = +#if L==1 // ca + "" // Necessita traducció +#elif L==2 // de + "" // Need Übersetzung +#elif L==3 // en + "" +#elif L==4 // es + "" +#elif L==5 // fr + "" // Besoin de traduction +#elif L==6 // gn + "" // Okoteve traducción +#elif L==7 // it + "" // Bisogno di traduzione +#elif L==8 // pl + "" // Potrzebujesz tlumaczenie +#elif L==9 // pt + "" // Precisa de tradução #endif , [ActReqDelThrCtrUsr] =