Version 16.161.1

This commit is contained in:
Antonio Cañas Vargas 2017-03-22 01:39:43 +01:00
parent 465d72923a
commit 66f7552425
2 changed files with 3 additions and 30 deletions

View File

@ -112,7 +112,6 @@ static void Agd_GetListEvents (Agd_AgendaType_t AgendaType);
static void Agd_GetDataOfEventByCod (struct AgendaEvent *AgdEvent);
static void Agd_GetEventTxtFromDB (struct AgendaEvent *AgdEvent,
char Txt[Cns_MAX_BYTES_TEXT + 1]);
static bool Agd_CheckIfSimilarEventExists (struct AgendaEvent *AgdEvent);
static void Agd_CreateEvent (struct AgendaEvent *AgdEvent,const char *Txt);
static void Agd_UpdateEvent (struct AgendaEvent *AgdEvent,const char *Txt);
@ -1635,7 +1634,6 @@ void Agd_RequestCreatOrEditEvent (void)
void Agd_RecFormEvent (void)
{
extern const char *Txt_Already_existed_an_event_with_the_title_X;
extern const char *Txt_You_must_specify_the_title_of_the_event;
extern const char *Txt_Created_new_event_X;
extern const char *Txt_The_event_has_been_modified;
@ -1677,18 +1675,7 @@ void Agd_RecFormEvent (void)
}
/***** Check if event is correct *****/
if (AgdEvent.Event[0]) // If there's event
{
/* If title of event was in database... */
if (Agd_CheckIfSimilarEventExists (&AgdEvent))
{
NewEventIsCorrect = false;
sprintf (Gbl.Message,Txt_Already_existed_an_event_with_the_title_X,
AgdEvent.Event);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
}
}
else // If there is no event
if (!AgdEvent.Event[0]) // If there is no event
{
NewEventIsCorrect = false;
Lay_ShowAlert (Lay_WARNING,Txt_You_must_specify_the_title_of_the_event);
@ -1724,21 +1711,6 @@ 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_BYTES_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 *******************************/
/*****************************************************************************/

View File

@ -210,13 +210,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.161 (2017-03-22)"
#define Log_PLATFORM_VERSION "SWAD 16.161.1 (2017-03-22)"
#define CSS_FILE "swad16.161.css"
#define JS_FILE "swad16.144.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.161.1: Mar 22, 2017 Changes in agenda. (217380 lines)
Version 16.161: Mar 22, 2017 Changes in agenda. (217404 lines)
Version 16.160.2: Mar 21, 2017 Changes in agenda. Not finished. (217348 lines)
Version 16.160.1: Mar 21, 2017 Changes in agenda. Not finished. (217347 lines)