diff --git a/css/swad19.97.css b/css/swad19.97.13.css similarity index 99% rename from css/swad19.97.css rename to css/swad19.97.13.css index 59f49fa34..b7f0e04a4 100644 --- a/css/swad19.97.css +++ b/css/swad19.97.13.css @@ -3970,7 +3970,7 @@ a.PAG:hover, .PAG_CUR } .INPUT_SHORT_NAME { - width:90px; + width:180px; } .INPUT_FULL_NAME { diff --git a/swad_centre.c b/swad_centre.c index b48554bd5..5e57f4173 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -747,10 +747,7 @@ static void Ctr_ConfigFullName (bool PutForm) static void Ctr_ConfigShrtName (bool PutForm) { - extern const char *Txt_Short_name; - - Hie_ConfigShrtName (PutForm,Txt_Short_name,ActRenCtrShoCfg, - Gbl.Hierarchy.Ctr.ShrtName); + Hie_ConfigShrtName (PutForm,ActRenCtrShoCfg,Gbl.Hierarchy.Ctr.ShrtName); } /*****************************************************************************/ @@ -821,26 +818,7 @@ static void Ctr_ConfigWWW (bool PutForm) static void Ctr_ConfigShortcut (void) { - extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; - extern const char *Txt_Shortcut; - - HTM_TR_Begin (NULL); - - Hie_ConfigLabel (NULL,Txt_Shortcut); - - HTM_TD_Begin ("class=\"DAT LM\""); - HTM_A_Begin ("href=\"%s/%s?ctr=%ld\" class=\"DAT\" target=\"_blank\"", - Cfg_URL_SWAD_CGI, - Lan_STR_LANG_ID[Gbl.Prefs.Language], - Gbl.Hierarchy.Ctr.CtrCod); - HTM_TxtF ("%s/%s?ctr=%ld", - Cfg_URL_SWAD_CGI, - Lan_STR_LANG_ID[Gbl.Prefs.Language], - Gbl.Hierarchy.Ctr.CtrCod); - HTM_A_End (); - HTM_TD_End (); - - HTM_TR_End (); + Hie_ConfigShortcut ("ctr",Gbl.Hierarchy.Ctr.CtrCod); } /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 8848e6c15..294ec8559 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -492,8 +492,8 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.97.12 (2019-12-26)" -#define CSS_FILE "swad19.97.css" +#define Log_PLATFORM_VERSION "SWAD 19.97.13 (2019-12-26)" +#define CSS_FILE "swad19.97.13.css" #define JS_FILE "swad19.91.1.js" /* // TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.) @@ -502,7 +502,8 @@ ps2pdf source.ps destination.pdf Version 19.99: Dec 26, 2019 Map in country information. (? lines) Version 19.98: Dec 26, 2019 Map in institution information. (? lines) - Version 19.97.13: Dec 26, 2019 Code refactoring in country information. (? lines) + Version 19.97.14: Dec 26, 2019 Code refactoring in country information. (? lines) + Version 19.97.13: Dec 26, 2019 Code refactoring in course, degree, centre and institution information. (249255 lines) Version 19.97.12: Dec 26, 2019 Code refactoring in course, degree, centre and institution information. (249298 lines) Version 19.97.11: Dec 26, 2019 Code refactoring in course, degree, centre and institution information. (249353 lines) Version 19.97.10: Dec 26, 2019 Code refactoring in course, degree, centre and institution information. (249394 lines) diff --git a/swad_course.c b/swad_course.c index f86205db8..2786d7a2b 100644 --- a/swad_course.c +++ b/swad_course.c @@ -85,8 +85,8 @@ static void Crs_ConfigTitle (bool PutLink); static void Crs_ConfigDegree (bool PrintView); static void Crs_ConfigFullName (bool PutForm); static void Crs_ConfigShrtName (bool PutForm); -static void Crs_ConfigYear (bool IsForm); -static void Crs_ConfigInstitutionalCode (bool IsForm); +static void Crs_ConfigYear (bool PutForm); +static void Crs_ConfigInstitutionalCode (bool PutForm); static void Crs_ConfigInternalCode (void); static void Crs_ConfigShortcut (void); static void Crs_ConfigQR (void); @@ -184,7 +184,7 @@ static void Crs_Configuration (bool PrintView) extern const char *Hlp_COURSE_Information; bool PutLink; bool PutFormName; - bool IsForm; + bool PutFormYear; /***** Trivial check *****/ if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected @@ -193,6 +193,7 @@ static void Crs_Configuration (bool PrintView) /***** Initializations *****/ PutLink = !PrintView && Gbl.Hierarchy.Deg.WWW[0]; PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM; + PutFormYear = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_TCH; /***** Contextual menu *****/ if (!PrintView) @@ -226,13 +227,12 @@ static void Crs_Configuration (bool PrintView) Crs_ConfigShrtName (PutFormName); /***** Course year *****/ - IsForm = (!PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_TCH); - Crs_ConfigYear (IsForm); + Crs_ConfigYear (PutFormYear); if (!PrintView) { /***** Institutional code of the course *****/ - Crs_ConfigInstitutionalCode (IsForm); + Crs_ConfigInstitutionalCode (PutFormYear); /***** Internal code of the course *****/ Crs_ConfigInternalCode (); @@ -352,17 +352,14 @@ static void Crs_ConfigFullName (bool PutForm) static void Crs_ConfigShrtName (bool PutForm) { - extern const char *Txt_Short_name; - - Hie_ConfigShrtName (PutForm,Txt_Short_name,ActRenCrsShoCfg, - Gbl.Hierarchy.Crs.ShrtName); + Hie_ConfigShrtName (PutForm,ActRenCrsShoCfg,Gbl.Hierarchy.Crs.ShrtName); } /*****************************************************************************/ /***************** Show course year in course configuration ******************/ /*****************************************************************************/ -static void Crs_ConfigYear (bool IsForm) +static void Crs_ConfigYear (bool PutForm) { extern const char *Txt_Year_OF_A_DEGREE; extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE]; @@ -374,7 +371,7 @@ static void Crs_ConfigYear (bool IsForm) Hie_ConfigLabel ("OthCrsYear",Txt_Year_OF_A_DEGREE); HTM_TD_Begin ("class=\"DAT LM\""); - if (IsForm) + if (PutForm) { Frm_StartForm (ActChgCrsYeaCfg); HTM_SELECT_Begin (true, @@ -400,7 +397,7 @@ static void Crs_ConfigYear (bool IsForm) /************* Show institutional code in course configuration ***************/ /*****************************************************************************/ -static void Crs_ConfigInstitutionalCode (bool IsForm) +static void Crs_ConfigInstitutionalCode (bool PutForm) { extern const char *Txt_Institutional_code; @@ -409,7 +406,7 @@ static void Crs_ConfigInstitutionalCode (bool IsForm) Hie_ConfigLabel ("InsCrsCod",Txt_Institutional_code); HTM_TD_Begin ("class=\"DAT LM\""); - if (IsForm) + if (PutForm) { Frm_StartForm (ActChgInsCrsCodCfg); HTM_INPUT_TEXT ("InsCrsCod",Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD, @@ -450,26 +447,7 @@ static void Crs_ConfigInternalCode (void) static void Crs_ConfigShortcut (void) { - extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; - extern const char *Txt_Shortcut; - - HTM_TR_Begin (NULL); - - Hie_ConfigLabel (NULL,Txt_Shortcut); - - HTM_TD_Begin ("class=\"DAT LM\""); - HTM_A_Begin ("href=\"%s/%s?crs=%ld\" class=\"DAT\" target=\"_blank\"", - Cfg_URL_SWAD_CGI, - Lan_STR_LANG_ID[Gbl.Prefs.Language], - Gbl.Hierarchy.Crs.CrsCod); - HTM_TxtF ("%s/%s?crs=%ld", - Cfg_URL_SWAD_CGI, - Lan_STR_LANG_ID[Gbl.Prefs.Language], - Gbl.Hierarchy.Crs.CrsCod); - HTM_A_End (); - HTM_TD_End (); - - HTM_TR_End (); + Hie_ConfigShortcut ("crs",Gbl.Hierarchy.Crs.CrsCod); } /*****************************************************************************/ diff --git a/swad_degree.c b/swad_degree.c index 18aeb88f8..5ad479c05 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -459,10 +459,7 @@ static void Deg_ConfigFullName (bool PutForm) static void Deg_ConfigShrtName (bool PutForm) { - extern const char *Txt_Short_name; - - Hie_ConfigShrtName (PutForm,Txt_Short_name,ActRenDegShoCfg, - Gbl.Hierarchy.Deg.ShrtName); + Hie_ConfigShrtName (PutForm,ActRenDegShoCfg,Gbl.Hierarchy.Deg.ShrtName); } /*****************************************************************************/ @@ -480,26 +477,7 @@ static void Deg_ConfigWWW (bool PutForm) static void Deg_ConfigShortcut (void) { - extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; - extern const char *Txt_Shortcut; - - HTM_TR_Begin (NULL); - - Hie_ConfigLabel (NULL,Txt_Shortcut); - - HTM_TD_Begin ("class=\"DAT LM\""); - HTM_A_Begin ("href=\"%s/%s?deg=%ld\" class=\"DAT\" target=\"_blank\"", - Cfg_URL_SWAD_CGI, - Lan_STR_LANG_ID[Gbl.Prefs.Language], - Gbl.Hierarchy.Deg.DegCod); - HTM_TxtF ("%s/%s?deg=%ld", - Cfg_URL_SWAD_CGI, - Lan_STR_LANG_ID[Gbl.Prefs.Language], - Gbl.Hierarchy.Deg.DegCod); - HTM_A_End (); - HTM_TD_End (); - - HTM_TR_End (); + Hie_ConfigShortcut ("deg",Gbl.Hierarchy.Deg.DegCod); } /*****************************************************************************/ diff --git a/swad_hierarchy.c b/swad_hierarchy.c index 53e60508d..7c41fc0e0 100644 --- a/swad_hierarchy.c +++ b/swad_hierarchy.c @@ -136,12 +136,14 @@ void Hie_ConfigFullName (bool PutForm,const char *Label,Act_Action_t NextAction, /********* Show institution short name in institution configuration **********/ /*****************************************************************************/ -void Hie_ConfigShrtName (bool PutForm,const char *Label,Act_Action_t NextAction, +void Hie_ConfigShrtName (bool PutForm,Act_Action_t NextAction, const char ShrtName[Hie_MAX_BYTES_SHRT_NAME + 1]) { + extern const char *Txt_Short_name; + HTM_TR_Begin (NULL); - Hie_ConfigLabel ("ShortName",Label); + Hie_ConfigLabel ("ShortName",Txt_Short_name); HTM_TD_Begin ("class=\"DAT_N LM\""); if (PutForm) @@ -196,6 +198,34 @@ void Hie_ConfigWWW (bool PutForm,Act_Action_t NextAction, HTM_TR_End (); } +/*****************************************************************************/ +/********************** Show shortcut in configuration ***********************/ +/*****************************************************************************/ + +void Hie_ConfigShortcut (const char *ParamName,long HieCod) + { + extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; + extern const char *Txt_Shortcut; + + HTM_TR_Begin (NULL); + + Hie_ConfigLabel (NULL,Txt_Shortcut); + + HTM_TD_Begin ("class=\"DAT LM\""); + HTM_A_Begin ("href=\"%s/%s?%s=%ld\" class=\"DAT\" target=\"_blank\"", + Cfg_URL_SWAD_CGI, + Lan_STR_LANG_ID[Gbl.Prefs.Language], + ParamName,HieCod); + HTM_TxtF ("%s/%s?%s=%ld", + Cfg_URL_SWAD_CGI, + Lan_STR_LANG_ID[Gbl.Prefs.Language], + ParamName,HieCod); + HTM_A_End (); + HTM_TD_End (); + + HTM_TR_End (); + } + /*****************************************************************************/ /********** List pending institutions, centres, degrees and courses **********/ /*****************************************************************************/ diff --git a/swad_hierarchy.h b/swad_hierarchy.h index 8642bc05f..526c01b7b 100644 --- a/swad_hierarchy.h +++ b/swad_hierarchy.h @@ -70,10 +70,11 @@ void Hie_ConfigTitle (bool PutLink, void Hie_ConfigLabel (const char *Id,const char *Label); void Hie_ConfigFullName (bool PutForm,const char *Label,Act_Action_t NextAction, const char FullName[Hie_MAX_BYTES_FULL_NAME + 1]); -void Hie_ConfigShrtName (bool PutForm,const char *Label,Act_Action_t NextAction, +void Hie_ConfigShrtName (bool PutForm,Act_Action_t NextAction, const char ShrtName[Hie_MAX_BYTES_SHRT_NAME + 1]); void Hie_ConfigWWW (bool PutForm,Act_Action_t NextAction, const char WWW[Cns_MAX_BYTES_WWW + 1]); +void Hie_ConfigShortcut (const char *ParamName,long HieCod); void Hie_SeePending (void); diff --git a/swad_institution.c b/swad_institution.c index dd471883a..e337e1df4 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -565,10 +565,7 @@ static void Ins_ConfigFullName (bool PutForm) static void Ins_ConfigShrtName (bool PutForm) { - extern const char *Txt_Short_name; - - Hie_ConfigShrtName (PutForm,Txt_Short_name,ActRenInsShoCfg, - Gbl.Hierarchy.Ins.ShrtName); + Hie_ConfigShrtName (PutForm,ActRenInsShoCfg,Gbl.Hierarchy.Ins.ShrtName); } /*****************************************************************************/ @@ -586,26 +583,7 @@ static void Ins_ConfigWWW (bool PutForm) static void Ins_ConfigShortcut (void) { - extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; - extern const char *Txt_Shortcut; - - HTM_TR_Begin (NULL); - - Hie_ConfigLabel (NULL,Txt_Shortcut); - - HTM_TD_Begin ("class=\"LM\""); - HTM_A_Begin ("href=\"%s/%s?ins=%ld\" class=\"DAT\" target=\"_blank\"", - Cfg_URL_SWAD_CGI, - Lan_STR_LANG_ID[Gbl.Prefs.Language], - Gbl.Hierarchy.Ins.InsCod); - HTM_TxtF ("%s/%s?ins=%ld", - Cfg_URL_SWAD_CGI, - Lan_STR_LANG_ID[Gbl.Prefs.Language], - Gbl.Hierarchy.Ins.InsCod); - HTM_A_End (); - HTM_TD_End (); - - HTM_TR_End (); + Hie_ConfigShortcut ("ins",Gbl.Hierarchy.Ins.InsCod); } /*****************************************************************************/