From e006c0f0a80b5632cd1f31f8e669539ebff2ab1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Fri, 9 Dec 2016 18:22:25 +0100 Subject: [PATCH] Version 16.92.4 --- swad_agenda.c | 33 ++++++++++++++++++--------------- swad_changelog.h | 3 ++- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/swad_agenda.c b/swad_agenda.c index 06d3062b3..994b227d3 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -1241,21 +1241,6 @@ void Agd_MakeEventPublic (void) Agd_ShowMyAgenda (); } -/*****************************************************************************/ -/*********** Check if the title or the folder of an event exists *************/ -/*****************************************************************************/ - -static bool Agd_CheckIfSimilarEventExists (struct AgendaEvent *AgdEvent) - { - char Query[256+Agd_MAX_LENGTH_EVENT]; - - /***** Get number of events with a field value from database *****/ - sprintf (Query,"SELECT COUNT(*) FROM agendas" - " WHERE UsrCod='%ld' AND Event='%s' AND AgdCod<>'%ld'", - AgdEvent->UsrCod,AgdEvent->Event,AgdEvent->AgdCod); - return (DB_QueryCOUNT (Query,"can not get similar events") != 0); - } - /*****************************************************************************/ /******************** Put a form to create a new event ***********************/ /*****************************************************************************/ @@ -1399,6 +1384,9 @@ void Agd_RecFormEvent (void) bool NewEventIsCorrect = true; char Txt[Cns_MAX_BYTES_TEXT+1]; + /***** Set author of the event *****/ + AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; + /***** Get the code of the event *****/ ItsANewEvent = ((AgdEvent.AgdCod = Agd_GetParamAgdCod ()) == -1L); @@ -1476,6 +1464,21 @@ void Agd_RecFormEvent (void) Agd_RequestCreatOrEditEvent (); } +/*****************************************************************************/ +/*********** Check if the title or the folder of an event exists *************/ +/*****************************************************************************/ + +static bool Agd_CheckIfSimilarEventExists (struct AgendaEvent *AgdEvent) + { + char Query[256+Agd_MAX_LENGTH_EVENT]; + + /***** Get number of events with a field value from database *****/ + sprintf (Query,"SELECT COUNT(*) FROM agendas" + " WHERE UsrCod='%ld' AND Event='%s' AND AgdCod<>'%ld'", + AgdEvent->UsrCod,AgdEvent->Event,AgdEvent->AgdCod); + return (DB_QueryCOUNT (Query,"can not get similar events") != 0); + } + /*****************************************************************************/ /************************** Create a new event *******************************/ /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 4b4a293d9..ffac3e9d8 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -185,13 +185,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.92.3 (2016-12-09)" +#define Log_PLATFORM_VERSION "SWAD 16.92.4 (2016-12-09)" #define CSS_FILE "swad16.86.5.css" #define JS_FILE "swad16.90.2.js" // 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 16.92.4: Dec 09, 2016 Fixed bug in edition of user's agenda. (? lines) Version 16.92.3: Dec 09, 2016 Contextual help on user's public profile. (210310 lines) Version 16.92.2: Dec 09, 2016 New icons to view user's profile ant to view user's record card in public agenda. (210308 lines) Version 16.92.1: Dec 09, 2016 New icon to view user's profile in user's record card. (210277 lines)