mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-09 10:15:24 +02:00
Version 15.35.2
This commit is contained in:
parent
af0442e254
commit
de2931094e
|
@ -108,11 +108,12 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.35.1 (2015/11/03)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.35.2 (2015/11/04)"
|
||||
|
||||
// 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 15.35.2: Nov 04, 2015 Fixed bug in edition of degrees. (186979 lines)
|
||||
Version 15.35.1: Nov 03, 2015 Confirmation message after removing a notice. (186979 lines)
|
||||
Version 15.35: Nov 03, 2015 Request confirmation on notice removal. (186944 lines)
|
||||
1 change necessary in database:
|
||||
|
|
|
@ -119,7 +119,7 @@ static void Deg_RemoveDegreeTypeCompletely (long DegTypCod);
|
|||
static void Deg_RemoveDegreeCompletely (long DegCod);
|
||||
static void Deg_RenameDegree (struct Degree *Deg,Cns_ShortOrFullName_t ShortOrFullName);
|
||||
static bool Deg_CheckIfDegreeTypeNameExists (const char *DegTypName,long DegTypCod);
|
||||
static bool Deg_CheckIfDegreeNameExists (long DegTypCod,const char *FieldName,const char *Name,long DegCod);
|
||||
static bool Deg_CheckIfDegreeNameExists (long CtrCod,const char *FieldName,const char *Name,long DegCod);
|
||||
static void Deg_ChangeDegYear (struct Degree *Deg,Deg_FirstOrLastYear_t FirstOrLastYear);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -2644,13 +2644,13 @@ static void Deg_RecFormRequestOrCreateDeg (unsigned Status)
|
|||
if (Deg->WWW[0])
|
||||
{
|
||||
/***** If name of degree was in database... *****/
|
||||
if (Deg_CheckIfDegreeNameExists (Deg->DegTypCod,"ShortName",Deg->ShortName,-1L))
|
||||
if (Deg_CheckIfDegreeNameExists (Deg->CtrCod,"ShortName",Deg->ShortName,-1L))
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_The_degree_X_already_exists,
|
||||
Deg->ShortName);
|
||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||
}
|
||||
else if (Deg_CheckIfDegreeNameExists (Deg->DegTypCod,"FullName",Deg->FullName,-1L))
|
||||
else if (Deg_CheckIfDegreeNameExists (Deg->CtrCod,"FullName",Deg->FullName,-1L))
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_The_degree_X_already_exists,
|
||||
Deg->FullName);
|
||||
|
@ -3381,7 +3381,7 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShortOrFullName_t ShortOrFu
|
|||
if (strcmp (CurrentDegName,NewDegName)) // Different names
|
||||
{
|
||||
/***** If degree was in database... *****/
|
||||
if (Deg_CheckIfDegreeNameExists (Deg->DegTypCod,ParamName,NewDegName,Deg->DegCod))
|
||||
if (Deg_CheckIfDegreeNameExists (Deg->CtrCod,ParamName,NewDegName,Deg->DegCod))
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_The_degree_X_already_exists,
|
||||
NewDegName);
|
||||
|
@ -3432,14 +3432,14 @@ static bool Deg_CheckIfDegreeTypeNameExists (const char *DegTypName,long DegTypC
|
|||
/********************* Check if the name of degree exists ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static bool Deg_CheckIfDegreeNameExists (long DegTypCod,const char *FieldName,const char *Name,long DegCod)
|
||||
static bool Deg_CheckIfDegreeNameExists (long CtrCod,const char *FieldName,const char *Name,long DegCod)
|
||||
{
|
||||
char Query[512];
|
||||
|
||||
/***** Get number of degrees with a type and a name from database *****/
|
||||
sprintf (Query,"SELECT COUNT(*) FROM degrees"
|
||||
" WHERE DegTypCod='%ld' AND %s='%s' AND DegCod<>'%ld'",
|
||||
DegTypCod,FieldName,Name,DegCod);
|
||||
" WHERE CtrCod='%ld' AND %s='%s' AND DegCod<>'%ld'",
|
||||
CtrCod,FieldName,Name,DegCod);
|
||||
return (DB_QueryCOUNT (Query,"can not check if the name of a degree already existed") != 0);
|
||||
}
|
||||
|
||||
|
@ -3515,13 +3515,13 @@ void Deg_ChangeDegreeType (void)
|
|||
Deg_GetDataOfDegreeByCod (Deg);
|
||||
|
||||
/***** If degree was in database... *****/
|
||||
if (Deg_CheckIfDegreeNameExists (NewDegTypCod,"ShortName",Deg->ShortName,-1L))
|
||||
if (Deg_CheckIfDegreeNameExists (Deg->CtrCod,"ShortName",Deg->ShortName,-1L))
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_The_degree_X_already_exists,
|
||||
Deg->ShortName);
|
||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||
}
|
||||
else if (Deg_CheckIfDegreeNameExists (NewDegTypCod,"FullName",Deg->FullName,-1L))
|
||||
else if (Deg_CheckIfDegreeNameExists (Deg->CtrCod,"FullName",Deg->FullName,-1L))
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_The_degree_X_already_exists,
|
||||
Deg->FullName);
|
||||
|
|
Loading…
Reference in New Issue
Block a user