From 517ee75462ef898732a2574cde2663eef3863f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 18 Dec 2019 20:55:56 +0100 Subject: [PATCH] Version19.95.2 --- Makefile | 4 ++-- sql/swad.sql | 5 +++-- swad_centre.c | 35 ++++++++++++++++++++++++++++++++++- swad_centre.h | 2 ++ swad_changelog.h | 3 ++- 5 files changed, 43 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 8f0fea474..c7b72405f 100644 --- a/Makefile +++ b/Makefile @@ -42,8 +42,8 @@ OBJS = swad_account.o swad_action.o swad_agenda.o swad_alert.o \ swad_help.o swad_hierarchy.o swad_holiday.o swad_HTML.o \ swad_icon.o swad_ID.o swad_indicator.o swad_info.o swad_institution.o \ swad_language.o swad_layout.o swad_link.o swad_log.o swad_logo.o \ - swad_mail.o swad_main.o swad_mark.o swad_match.o swad_match_result.o \ - swad_media.o swad_menu.o swad_message.o swad_MFU.o \ + swad_mail.o swad_main.o swad_map.o swad_mark.o swad_match.o \ + swad_match_result.o swad_media.o swad_menu.o swad_message.o swad_MFU.o \ swad_network.o swad_nickname.o swad_notice.o swad_notification.o \ swad_pagination.o swad_parameter.o swad_password.o swad_photo.o \ swad_place.o swad_plugin.o swad_privacy.o swad_profile.o swad_project.o \ diff --git a/sql/swad.sql b/sql/swad.sql index 439ac64ee..44afa3083 100644 --- a/sql/swad.sql +++ b/sql/swad.sql @@ -1058,7 +1058,7 @@ CREATE TABLE IF NOT EXISTS projects ( INDEX(CrsCod,Hidden), INDEX(CrsCod,CreatTime), INDEX(CrsCod,ModifTime), - INDEX(CrsCod,DptCod); + INDEX(CrsCod,DptCod)); -- -- Table sessions: stores the information of open sessions -- @@ -1082,7 +1082,8 @@ CREATE TABLE IF NOT EXISTS sessions ( SearchString VARCHAR(255) NOT NULL DEFAULT '', SideCols TINYINT NOT NULL DEFAULT 3, UNIQUE INDEX(SessionId), - INDEX(UsrCod));-- + INDEX(UsrCod)); +-- -- Table sta_degrees: stores statistics about degrees -- CREATE TABLE IF NOT EXISTS sta_degrees ( diff --git a/swad_centre.c b/swad_centre.c index 09ce18974..4e6b77212 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -46,6 +46,7 @@ #include "swad_institution.h" #include "swad_language.h" #include "swad_logo.h" +#include "swad_map.h" #include "swad_parameter.h" #include "swad_QR.h" #include "swad_string.h" @@ -88,6 +89,7 @@ static void Ctr_PutIconsCtrConfig (void); static void Ctr_PutIconToChangePhoto (void); static void Ctr_ConfigTitle (bool PutLink); static void Ctr_ConfigMap (void); +static void Ctr_ConfigCoordinates (void); static void Ctr_ConfigPhoto (bool PrintView,bool PutLink); static void Ctr_ConfigInstitution (bool PrintView); static void Ctr_ConfigFullName (bool PrintView); @@ -340,6 +342,10 @@ static void Ctr_Configuration (bool PrintView) /***** Place *****/ Ctr_ConfigPlace (PrintView); + /***** Coordinates *****/ + if (!PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM) + Ctr_ConfigCoordinates (); + /***** Centre WWW *****/ Ctr_ConfigWWW (PrintView); @@ -489,7 +495,7 @@ static void Ctr_ConfigMap (void) "}).addTo(mymap);\n"); /* Marker */ - HTM_Txt ("\tvar marker = L.marker([37.19704, -3.62451]).addTo(mymap);"); + HTM_Txt ("\tvar marker = L.marker([37.19684, -3.62436]).addTo(mymap);"); HTM_TxtF ("\tmarker.bindPopup(\"%s
%s\").openPopup();", Gbl.Hierarchy.Ctr.ShrtName, @@ -498,6 +504,33 @@ static void Ctr_ConfigMap (void) HTM_SCRIPT_End (); } +/*****************************************************************************/ +/************************** Edit centre coordinates **************************/ +/*****************************************************************************/ + +static void Ctr_ConfigCoordinates (void) + { + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + + HTM_TR_Begin (NULL); + + HTM_TD_Begin ("class=\"RM\""); + HTM_LABEL_Begin ("for=\"WWW\" class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_TxtF ("%s:","Latitud"); // TODO: Need translation!!!! + HTM_LABEL_End (); + HTM_TD_End (); + + HTM_TD_Begin ("class=\"LM\""); + /* Form to change centre WWW */ + Frm_StartForm (ActChgCtrWWWCfg); + HTM_INPUT_URL ("WWW",Gbl.Hierarchy.Ctr.WWW,true, + "class=\"INPUT_WWW\""); + Frm_EndForm (); + HTM_TD_End (); + + HTM_TR_End (); + } + /*****************************************************************************/ /***************************** Draw centre photo *****************************/ /*****************************************************************************/ diff --git a/swad_centre.h b/swad_centre.h index 414bd19d5..fb039ba07 100644 --- a/swad_centre.h +++ b/swad_centre.h @@ -32,6 +32,7 @@ #include "swad_action.h" #include "swad_constant.h" #include "swad_degree.h" +#include "swad_map.h" #include "swad_role_type.h" /*****************************************************************************/ @@ -64,6 +65,7 @@ struct Centre long CtrCod; // Centre code long InsCod; // Institution code long PlcCod; // Place code + struct Coordinates Coordinates; // Latitude and longitude Ctr_Status_t Status; // Centre status long RequesterUsrCod; // User code of the person who requested the creation of this centre char ShrtName[Hie_MAX_BYTES_SHRT_NAME + 1]; diff --git a/swad_changelog.h b/swad_changelog.h index 146ce47a4..542f6074d 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -490,13 +490,14 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.95.1 (2019-12-18)" +#define Log_PLATFORM_VERSION "SWAD 19.95.2 (2019-12-18)" #define CSS_FILE "swad19.95.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.) // TODO: Impedir la creación y edición de proyectos si no son editables. + Version 19.95.2: Dec 18, 2019 Buf fixes in swad.sql. (? lines) Version 19.95.1: Dec 18, 2019 Map marker in centre information. (249331 lines) Version 19.95: Dec 17, 2019 Trying Leaflet (open-source JavaScript library for mobile-friendly interactive maps). (249323 lines) Version 19.94.3: Dec 17, 2019 Code refactoring in centre information. (249282 lines)