From beac9eeb27baa764f09342c23778dbe4e6ac1ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Tue, 24 Dec 2019 15:14:41 +0100 Subject: [PATCH] Version19.97.7 --- swad_centre.c | 25 ++- swad_changelog.h | 4 +- swad_institution.c | 495 ++++++++++++++++++++++++++++++++------------- 3 files changed, 378 insertions(+), 146 deletions(-) diff --git a/swad_centre.c b/swad_centre.c index 436f133f7..e6eb3fc90 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -88,6 +88,7 @@ static void Ctr_Configuration (bool PrintView); static void Ctr_PutIconsCtrConfig (void); static void Ctr_PutIconToChangePhoto (void); static void Ctr_ConfigTitle (bool PutLink); +static bool Ctr_GetIfMapIsAvailable (void); static void Ctr_ConfigMap (void); static void Ctr_ConfigLatitude (void); static void Ctr_ConfigLongitude (void); @@ -95,7 +96,7 @@ static void Ctr_ConfigAltitude (void); static void Ctr_ConfigPhoto (bool PrintView,bool PutLink); static void Ctr_ConfigInstitution (bool PrintView); static void Ctr_ConfigFullName (bool PrintView); -static void Ctr_ConfigShortName (bool PrintView); +static void Ctr_ConfigShrtName (bool PrintView); static void Ctr_ConfigPlace (bool PrintView); static void Ctr_ConfigWWW (bool PrintView); static void Ctr_ConfigShortcut (void); @@ -329,9 +330,7 @@ static void Ctr_Configuration (bool PrintView) Ctr_ConfigTitle (PutLink); /***** Centre map *****/ - // Coordinates 0, 0 means not set ==> don't show map - if (Gbl.Hierarchy.Ctr.Coord.Latitude || - Gbl.Hierarchy.Ctr.Coord.Longitude) + if (Ctr_GetIfMapIsAvailable ()) Ctr_ConfigMap (); /***** Centre photo *****/ @@ -345,7 +344,7 @@ static void Ctr_Configuration (bool PrintView) /***** Centre name *****/ Ctr_ConfigFullName (PrintView); - Ctr_ConfigShortName (PrintView); + Ctr_ConfigShrtName (PrintView); /***** Place *****/ Ctr_ConfigPlace (PrintView); @@ -460,6 +459,17 @@ static void Ctr_ConfigTitle (bool PutLink) HTM_DIV_End (); } +/*****************************************************************************/ +/******************** Check if centre map should be shown ********************/ +/*****************************************************************************/ + +static bool Ctr_GetIfMapIsAvailable (void) + { + /***** Coordinates 0, 0 means not set ==> don't show map *****/ + return (bool) (Gbl.Hierarchy.Ctr.Coord.Latitude || + Gbl.Hierarchy.Ctr.Coord.Longitude); + } + /*****************************************************************************/ /****************************** Draw centre map ******************************/ /*****************************************************************************/ @@ -701,7 +711,8 @@ static void Ctr_ConfigInstitution (bool PrintView) HTM_TR_Begin (NULL); HTM_TD_Begin ("class=\"RM\""); - HTM_LABEL_Begin ("for=\"OthInsCod\" class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_LABEL_Begin ("for=\"OthInsCod\" class=\"%s\"", + The_ClassFormInBox[Gbl.Prefs.Theme]); HTM_TxtF ("%s:",Txt_Institution); HTM_LABEL_End (); HTM_TD_End (); @@ -777,7 +788,7 @@ static void Ctr_ConfigFullName (bool PrintView) /************** Show centre short name in centre configuration ***************/ /*****************************************************************************/ -static void Ctr_ConfigShortName (bool PrintView) +static void Ctr_ConfigShrtName (bool PrintView) { extern const char *The_ClassFormInBox[The_NUM_THEMES]; extern const char *Txt_Short_name; diff --git a/swad_changelog.h b/swad_changelog.h index daa38b89b..29960efa4 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.97.6 (2019-12-23)" +#define Log_PLATFORM_VERSION "SWAD 19.97.7 (2019-12-24)" #define CSS_FILE "swad19.97.css" #define JS_FILE "swad19.91.1.js" /* @@ -500,6 +500,8 @@ ps2pdf source.ps destination.pdf // TODO: Impedir la creación y edición de proyectos si no son editables. // TODO: No se puede entrar con DNI '1' suponiendo que no tenga password ¿por qué? + Version 19.98: Dec 24, 2019 Map in institution information. (? lines) + Version 19.97.7: Dec 24, 2019 Code refactoring in institution information. (249383 lines) Version 19.97.6: Dec 23, 2019 Changes in forms to remove logos. (249199 lines) Version 19.97.5: Dec 20, 2019 Fixed bug in places. (249180 lines) Version 19.97.4: Dec 20, 2019 Optimization on alerts related with empty form fields. (249171 lines) diff --git a/swad_institution.c b/swad_institution.c index bb50b8a13..41a219b24 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -71,6 +71,20 @@ static struct Instit *Ins_EditingIns = NULL; // Static variable to keep the inst static void Ins_Configuration (bool PrintView); static void Ins_PutIconsToPrintAndUpload (void); +static void Ins_ConfigTitle (bool PutLink); +static bool Ins_GetIfMapIsAvailable (void); +static void Ins_ConfigMap (void); +static void Ins_ConfigCountry (bool PrintView); +static void Ins_ConfigFullName (bool PrintView); +static void Ins_ConfigShrtName (bool PrintView); +static void Ins_ConfigWWW (bool PrintView); +static void Ins_ConfigShortcut (void); +static void Ins_ConfigQR (void); +static void Ins_ConfigNumUsrs (void); +static void Ins_ConfigNumCtrs (void); +static void Ins_ConfigNumDegs (void); +static void Ins_ConfigNumCrss (void); +static void Ins_ConfigNumDpts (void); static void Ins_ShowNumUsrsInCrssOfIns (Rol_Role_t Role); static void Ins_ListInstitutions (void); @@ -304,22 +318,7 @@ void Ins_PrintConfiguration (void) static void Ins_Configuration (bool PrintView) { extern const char *Hlp_INSTITUTION_Information; - extern const char *The_ClassFormInBox[The_NUM_THEMES]; - extern const char *Txt_Country; - extern const char *Txt_Institution; - extern const char *Txt_Short_name; - extern const char *Txt_Web; - extern const char *Txt_Shortcut; - extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; - extern const char *Txt_QR_code; - extern const char *Txt_Centres; - extern const char *Txt_Centres_of_INSTITUTION_X; - extern const char *Txt_Degrees; - extern const char *Txt_Courses; - extern const char *Txt_Departments; - extern const char *Txt_Users_of_the_institution; - unsigned NumCty; - bool PutLink; + bool PutLink = !PrintView && Gbl.Hierarchy.Ins.WWW[0]; /***** Trivial check *****/ if (Gbl.Hierarchy.Ins.InsCod <= 0) // No institution selected @@ -334,10 +333,85 @@ static void Ins_Configuration (bool PrintView) Hlp_INSTITUTION_Information,Box_NOT_CLOSABLE); /***** Title *****/ - PutLink = !PrintView && Gbl.Hierarchy.Ins.WWW[0]; + Ins_ConfigTitle (PutLink); + + /***** Institution map *****/ + if (Ins_GetIfMapIsAvailable ()) + Ins_ConfigMap (); + + /***** Begin table *****/ + HTM_TABLE_BeginWidePadding (2); + + /***** Country *****/ + Ins_ConfigCountry (PrintView); + + /***** Institution name *****/ + Ins_ConfigFullName (PrintView); + Ins_ConfigShrtName (PrintView); + + /***** Institution WWW *****/ + Ins_ConfigWWW (PrintView); + + /***** Shortcut to the institution *****/ + Ins_ConfigShortcut (); + + if (PrintView) + /***** QR code with link to the institution *****/ + Ins_ConfigQR (); + else + { + /***** Number of users who claim to belong to this institution, + number of centres, + number of degrees, + number of courses, + number of departments *****/ + Ins_ConfigNumUsrs (); + Ins_ConfigNumCtrs (); + Ins_ConfigNumDegs (); + Ins_ConfigNumCrss (); + Ins_ConfigNumDpts (); + + /***** Number of users in courses of this institution *****/ + Ins_ShowNumUsrsInCrssOfIns (Rol_TCH); + Ins_ShowNumUsrsInCrssOfIns (Rol_NET); + Ins_ShowNumUsrsInCrssOfIns (Rol_STD); + Ins_ShowNumUsrsInCrssOfIns (Rol_UNK); + } + + /***** End table *****/ + HTM_TABLE_End (); + + /***** End box *****/ + Box_BoxEnd (); + } + +/*****************************************************************************/ +/********* Put contextual icons in configuration of an institution ***********/ +/*****************************************************************************/ + +static void Ins_PutIconsToPrintAndUpload (void) + { + /***** Icon to print info about institution *****/ + Ico_PutContextualIconToPrint (ActPrnInsInf,NULL); + + if (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM) + /***** Icon to upload logo of institution *****/ + Lgo_PutIconToChangeLogo (Hie_INS); + + /***** Put icon to view places *****/ + Plc_PutIconToViewPlaces (); + } + +/*****************************************************************************/ +/***************** Show title in institution configuration *******************/ +/*****************************************************************************/ + +static void Ins_ConfigTitle (bool PutLink) + { HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG\""); if (PutLink) - HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"FRAME_TITLE_BIG\" title=\"%s\"", + HTM_A_Begin ("href=\"%s\" target=\"_blank\"" + " class=\"FRAME_TITLE_BIG\" title=\"%s\"", Gbl.Hierarchy.Ins.WWW, Gbl.Hierarchy.Ins.FullName); Lgo_DrawLogo (Hie_INS,Gbl.Hierarchy.Ins.InsCod, @@ -347,15 +421,100 @@ static void Ins_Configuration (bool PrintView) if (PutLink) HTM_A_End (); HTM_DIV_End (); + } - /***** Begin table *****/ - HTM_TABLE_BeginWidePadding (2); +/*****************************************************************************/ +/******************** Check if centre map should be shown ********************/ +/*****************************************************************************/ + +// TODO: Change code!!!! + +static bool Ins_GetIfMapIsAvailable (void) + { + /***** Coordinates 0, 0 means not set ==> don't show map *****/ + return (bool) (Gbl.Hierarchy.Ctr.Coord.Latitude || + Gbl.Hierarchy.Ctr.Coord.Longitude); + } + +/*****************************************************************************/ +/****************************** Draw centre map ******************************/ +/*****************************************************************************/ + +// TODO: Change code!!!! + +static void Ins_ConfigMap (void) + { + /* https://leafletjs.com/examples/quick-start/ */ + /***** Leaflet CSS *****/ + HTM_Txt (""); + + /***** Leaflet script *****/ + /* Put this AFTER Leaflet's CSS */ + HTM_Txt (""); + + /***** Container for the map *****/ + HTM_DIV_Begin ("id=\"centre_mapid\""); + HTM_DIV_End (); + + /***** Script to draw the map *****/ + HTM_SCRIPT_Begin (NULL,NULL); + Str_SetDecimalPointToUS (); // To write the decimal point as a dot + + /* Let's create a map of the center of London with pretty Mapbox Streets tiles */ + HTM_TxtF ("\tvar mymap = L.map('centre_mapid').setView([%lg, %lg], 16);\n", + Gbl.Hierarchy.Ctr.Coord.Latitude, + Gbl.Hierarchy.Ctr.Coord.Longitude); + + /* Next we'll add a tile layer to add to our map, + in this case it's a Mapbox Streets tile layer. + Creating a tile layer usually involves + setting the URL template for the tile images, + the attribution text and the maximum zoom level of the layer. + In this example we'll use the mapbox/streets-v11 tiles + from Mapbox's Static Tiles API + (in order to use tiles from Mapbox, + you must also request an access token).*/ + HTM_Txt ("\tL.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {" + "attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox'," + "maxZoom: 20," + "id: 'mapbox/streets-v11'," + "accessToken: 'pk.eyJ1IjoiYWNhbmFzIiwiYSI6ImNrNGFoNXFxOTAzdHozcnA4d3Y0M3BwOGkifQ.uSg754Lv2iZEJg0W2pjiOQ'" + "}).addTo(mymap);\n"); + + /* Marker */ + HTM_TxtF ("\tvar marker = L.marker([%lg, %lg]).addTo(mymap);", + Gbl.Hierarchy.Ctr.Coord.Latitude, + Gbl.Hierarchy.Ctr.Coord.Longitude); + + HTM_TxtF ("\tmarker.bindPopup(\"%s
%s\").openPopup();", + Gbl.Hierarchy.Ctr.ShrtName, + Gbl.Hierarchy.Ins.ShrtName); + + Str_SetDecimalPointToLocal (); // Return to local system + HTM_SCRIPT_End (); + } + +/*****************************************************************************/ +/***************** Show country in institution configuration *****************/ +/*****************************************************************************/ + +static void Ins_ConfigCountry (bool PrintView) + { + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_Country; + unsigned NumCty; - /***** Country *****/ HTM_TR_Begin (NULL); HTM_TD_Begin ("class=\"RM\""); - HTM_LABEL_Begin ("for=\"OthCtyCod\" class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_LABEL_Begin ("for=\"OthCtyCod\" class=\"%s\"", + The_ClassFormInBox[Gbl.Prefs.Theme]); HTM_TxtF ("%s:",Txt_Country); HTM_LABEL_End (); HTM_TD_End (); @@ -390,8 +549,17 @@ static void Ins_Configuration (bool PrintView) HTM_TD_End (); HTM_TR_End (); + } + +/*****************************************************************************/ +/********* Show institution full name in institution configuration ***********/ +/*****************************************************************************/ + +static void Ins_ConfigFullName (bool PrintView) + { + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_Institution; - /***** Institution full name *****/ HTM_TR_Begin (NULL); HTM_TD_Begin ("class=\"RM\""); @@ -416,8 +584,17 @@ static void Ins_Configuration (bool PrintView) HTM_TD_End (); HTM_TR_End (); + } + +/*****************************************************************************/ +/********* Show institution short name in institution configuration **********/ +/*****************************************************************************/ + +static void Ins_ConfigShrtName (bool PrintView) + { + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_Short_name; - /***** Institution short name *****/ HTM_TR_Begin (NULL); HTM_TD_Begin ("class=\"RM\""); @@ -442,8 +619,17 @@ static void Ins_Configuration (bool PrintView) HTM_TD_End (); HTM_TR_End (); + } + +/*****************************************************************************/ +/************ Show institution WWW in institution configuration **************/ +/*****************************************************************************/ + +static void Ins_ConfigWWW (bool PrintView) + { + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_Web; - /***** Institution WWW *****/ HTM_TR_Begin (NULL); HTM_TD_Begin ("class=\"RM\""); @@ -476,8 +662,18 @@ static void Ins_Configuration (bool PrintView) HTM_TD_End (); HTM_TR_End (); + } + +/*****************************************************************************/ +/********** Show institution shortcut in institution configuration ***********/ +/*****************************************************************************/ + +static void Ins_ConfigShortcut (void) + { + extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_Shortcut; - /***** Shortcut to the institution *****/ HTM_TR_Begin (NULL); HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); @@ -497,126 +693,149 @@ static void Ins_Configuration (bool PrintView) HTM_TD_End (); HTM_TR_End (); - - if (PrintView) - { - /***** QR code with link to the institution *****/ - HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s:",Txt_QR_code); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"LM\""); - QR_LinkTo (250,"ins",Gbl.Hierarchy.Ins.InsCod); - HTM_TD_End (); - - HTM_TR_End (); - } - else - { - /***** Number of users who claim to belong to this institution *****/ - HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s:",Txt_Users_of_the_institution); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"DAT LM\""); - HTM_Unsigned (Usr_GetNumUsrsWhoClaimToBelongToIns (Gbl.Hierarchy.Ins.InsCod)); - HTM_TD_End (); - - HTM_TR_End (); - HTM_TR_Begin (NULL); - - /***** Number of centres *****/ - HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s:",Txt_Centres); - HTM_TD_End (); - - /* Form to go to see centres of this institution */ - HTM_TD_Begin ("class=\"LM\""); - Frm_StartFormGoTo (ActSeeCtr); - Ins_PutParamInsCod (Gbl.Hierarchy.Ins.InsCod); - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Centres_of_INSTITUTION_X, - Gbl.Hierarchy.Ins.ShrtName); - HTM_BUTTON_SUBMIT_Begin (Gbl.Title,"BT_LINK DAT",NULL); - HTM_Unsigned (Ctr_GetNumCtrsInIns (Gbl.Hierarchy.Ins.InsCod)); - HTM_BUTTON_End (); - Frm_EndForm (); - HTM_TD_End (); - - HTM_TR_End (); - - /***** Number of degrees *****/ - HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s:",Txt_Degrees); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"DAT LM\""); - HTM_Unsigned (Deg_GetNumDegsInIns (Gbl.Hierarchy.Ins.InsCod)); - HTM_TD_End (); - - HTM_TR_End (); - - /***** Number of courses *****/ - HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s:",Txt_Courses); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"DAT LM\""); - HTM_Unsigned (Crs_GetNumCrssInIns (Gbl.Hierarchy.Ins.InsCod)); - HTM_TD_End (); - - HTM_TR_End (); - - /***** Number of departments *****/ - HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s:",Txt_Departments); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"DAT LM\""); - HTM_Unsigned (Dpt_GetNumDepartmentsInInstitution (Gbl.Hierarchy.Ins.InsCod)); - HTM_TD_End (); - - HTM_TR_End (); - - /***** Number of users in courses of this institution *****/ - Ins_ShowNumUsrsInCrssOfIns (Rol_TCH); - Ins_ShowNumUsrsInCrssOfIns (Rol_NET); - Ins_ShowNumUsrsInCrssOfIns (Rol_STD); - Ins_ShowNumUsrsInCrssOfIns (Rol_UNK); - } - - /***** End table *****/ - HTM_TABLE_End (); - - /***** End box *****/ - Box_BoxEnd (); } /*****************************************************************************/ -/********* Put contextual icons in configuration of an institution ***********/ +/************* Show institution QR in institution configuration **************/ /*****************************************************************************/ -static void Ins_PutIconsToPrintAndUpload (void) +static void Ins_ConfigQR (void) { - /***** Icon to print info about institution *****/ - Ico_PutContextualIconToPrint (ActPrnInsInf,NULL); + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_QR_code; - if (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM) - /***** Icon to upload logo of institution *****/ - Lgo_PutIconToChangeLogo (Hie_INS); + HTM_TR_Begin (NULL); - /***** Put icon to view places *****/ - Plc_PutIconToViewPlaces (); + HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_TxtF ("%s:",Txt_QR_code); + HTM_TD_End (); + + HTM_TD_Begin ("class=\"LM\""); + QR_LinkTo (250,"ins",Gbl.Hierarchy.Ins.InsCod); + HTM_TD_End (); + + HTM_TR_End (); + } + +/*****************************************************************************/ +/** Show number of users who claim to belong to instit. in instit. config. ***/ +/*****************************************************************************/ + +static void Ins_ConfigNumUsrs (void) + { + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_Users_of_the_institution; + + HTM_TR_Begin (NULL); + + HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_TxtF ("%s:",Txt_Users_of_the_institution); + HTM_TD_End (); + + HTM_TD_Begin ("class=\"DAT LM\""); + HTM_Unsigned (Usr_GetNumUsrsWhoClaimToBelongToIns (Gbl.Hierarchy.Ins.InsCod)); + HTM_TD_End (); + + HTM_TR_End (); + } + +/*****************************************************************************/ +/*********** Show number of centres in institution configuration *************/ +/*****************************************************************************/ + +static void Ins_ConfigNumCtrs (void) + { + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_Centres; + extern const char *Txt_Centres_of_INSTITUTION_X; + + HTM_TR_Begin (NULL); + + HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_TxtF ("%s:",Txt_Centres); + HTM_TD_End (); + + /* Form to go to see centres of this institution */ + HTM_TD_Begin ("class=\"LM\""); + Frm_StartFormGoTo (ActSeeCtr); + Ins_PutParamInsCod (Gbl.Hierarchy.Ins.InsCod); + snprintf (Gbl.Title,sizeof (Gbl.Title), + Txt_Centres_of_INSTITUTION_X, + Gbl.Hierarchy.Ins.ShrtName); + HTM_BUTTON_SUBMIT_Begin (Gbl.Title,"BT_LINK DAT",NULL); + HTM_Unsigned (Ctr_GetNumCtrsInIns (Gbl.Hierarchy.Ins.InsCod)); + HTM_BUTTON_End (); + Frm_EndForm (); + HTM_TD_End (); + + HTM_TR_End (); + } + +/*****************************************************************************/ +/*********** Show number of degrees in institution configuration *************/ +/*****************************************************************************/ + +static void Ins_ConfigNumDegs (void) + { + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_Degrees; + + /***** Number of degrees *****/ + HTM_TR_Begin (NULL); + + HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_TxtF ("%s:",Txt_Degrees); + HTM_TD_End (); + + HTM_TD_Begin ("class=\"DAT LM\""); + HTM_Unsigned (Deg_GetNumDegsInIns (Gbl.Hierarchy.Ins.InsCod)); + HTM_TD_End (); + + HTM_TR_End (); + } + +/*****************************************************************************/ +/************ Show number of courses in institution configuration ************/ +/*****************************************************************************/ + +static void Ins_ConfigNumCrss (void) + { + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_Courses; + + HTM_TR_Begin (NULL); + + HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_TxtF ("%s:",Txt_Courses); + HTM_TD_End (); + + HTM_TD_Begin ("class=\"DAT LM\""); + HTM_Unsigned (Crs_GetNumCrssInIns (Gbl.Hierarchy.Ins.InsCod)); + HTM_TD_End (); + + HTM_TR_End (); + } + +/*****************************************************************************/ +/********** Show number of departments in institution configuration **********/ +/*****************************************************************************/ + +static void Ins_ConfigNumDpts (void) + { + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_Departments; + + HTM_TR_Begin (NULL); + + HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_TxtF ("%s:",Txt_Departments); + HTM_TD_End (); + + HTM_TD_Begin ("class=\"DAT LM\""); + HTM_Unsigned (Dpt_GetNumDepartmentsInInstitution (Gbl.Hierarchy.Ins.InsCod)); + HTM_TD_End (); + + HTM_TR_End (); } /*****************************************************************************/