mirror of https://github.com/acanas/swad-core.git
Version 16.232
This commit is contained in:
parent
19bff88643
commit
e3ba3b417d
|
@ -1674,13 +1674,13 @@ static void Ctr_PutParamOtherCtrCod (long CtrCod)
|
|||
/****************** Get parameter with code of other centre ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
long Ctr_GetAndCheckParamOtherCtrCod (void)
|
||||
long Ctr_GetAndCheckParamOtherCtrCod (long MinCodAllowed)
|
||||
{
|
||||
long CtrCod;
|
||||
|
||||
/***** Get and check parameter with code of centre *****/
|
||||
if ((CtrCod = Par_GetParToLong ("OthCtrCod")) <= 0)
|
||||
Lay_ShowErrorAndExit ("Code of centre is missing.");
|
||||
if ((CtrCod = Par_GetParToLong ("OthCtrCod")) < MinCodAllowed)
|
||||
Lay_ShowErrorAndExit ("Code of centre is missing or invalid.");
|
||||
|
||||
return CtrCod;
|
||||
}
|
||||
|
@ -1698,7 +1698,7 @@ void Ctr_RemoveCentre (void)
|
|||
char PathCtr[PATH_MAX + 1];
|
||||
|
||||
/***** Get centre code *****/
|
||||
Ctr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
||||
Ctr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||
|
||||
/***** Get data of the centre from database *****/
|
||||
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||
|
@ -1752,7 +1752,7 @@ void Ctr_ChangeCtrInsInConfig (void)
|
|||
struct Instit NewIns;
|
||||
|
||||
/***** Get parameter with institution code *****/
|
||||
NewIns.InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
||||
NewIns.InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||
|
||||
/***** Check if institution has changed *****/
|
||||
if (NewIns.InsCod != Gbl.CurrentCtr.Ctr.InsCod)
|
||||
|
@ -1834,11 +1834,10 @@ void Ctr_ChangeCentrePlace (void)
|
|||
long NewPlcCod;
|
||||
char Query[512];
|
||||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get centre code */
|
||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
||||
/***** Get centre code *****/
|
||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||
|
||||
/* Get parameter with centre code */
|
||||
/***** Get parameter with place code *****/
|
||||
NewPlcCod = Plc_GetParamPlcCod ();
|
||||
|
||||
/***** Get data of centre from database *****/
|
||||
|
@ -1866,7 +1865,7 @@ void Ctr_ChangeCentrePlace (void)
|
|||
|
||||
void Ctr_RenameCentreShort (void)
|
||||
{
|
||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||
Ctr_RenameCentre (&Gbl.Ctrs.EditingCtr,Cns_SHRT_NAME);
|
||||
}
|
||||
|
||||
|
@ -1881,7 +1880,7 @@ void Ctr_RenameCentreShortInConfig (void)
|
|||
|
||||
void Ctr_RenameCentreFull (void)
|
||||
{
|
||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||
Ctr_RenameCentre (&Gbl.Ctrs.EditingCtr,Cns_FULL_NAME);
|
||||
}
|
||||
|
||||
|
@ -2010,11 +2009,10 @@ void Ctr_ChangeCtrWWW (void)
|
|||
extern const char *Txt_You_can_not_leave_the_web_address_empty;
|
||||
char NewWWW[Cns_MAX_BYTES_WWW + 1];
|
||||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get the code of the centre */
|
||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
||||
/***** Get the code of the centre *****/
|
||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||
|
||||
/* Get the new WWW for the centre */
|
||||
/***** Get the new WWW for the centre *****/
|
||||
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||
|
||||
/***** Get data of centre *****/
|
||||
|
@ -2096,11 +2094,10 @@ void Ctr_ChangeCtrStatus (void)
|
|||
Ctr_Status_t Status;
|
||||
Ctr_StatusTxt_t StatusTxt;
|
||||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get centre code */
|
||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
||||
/***** Get centre code *****/
|
||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||
|
||||
/* Get parameter with status */
|
||||
/***** Get parameter with status *****/
|
||||
Status = (Ctr_Status_t)
|
||||
Par_GetParToUnsignedLong ("Status",
|
||||
0,
|
||||
|
|
|
@ -102,7 +102,7 @@ void Ctr_GetShortNameOfCentreByCod (struct Centre *Ctr);
|
|||
void Ctr_FreeListCentres (void);
|
||||
void Ctr_WriteSelectorOfCentre (void);
|
||||
void Ctr_PutParamCtrCod (long CtrCod);
|
||||
long Ctr_GetAndCheckParamOtherCtrCod (void);
|
||||
long Ctr_GetAndCheckParamOtherCtrCod (long MinCodAllowed);
|
||||
void Ctr_RemoveCentre (void);
|
||||
void Ctr_ChangeCtrInsInConfig (void);
|
||||
void Ctr_ContEditAfterChgCtrInConfig (void);
|
||||
|
|
|
@ -227,17 +227,20 @@
|
|||
|
||||
// TODO: Fix bug: An URL like https://openswad.org/es?a gives Internal Server Error
|
||||
|
||||
// TODO: Limit lenght of very big institution name in record card
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.231.4 (2017-05-31)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.232 (2017-05-31)"
|
||||
#define CSS_FILE "swad16.226.css"
|
||||
#define JS_FILE "swad16.206.3.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.232: May 31, 2017 Fix bug in selection of user's centre. (221042 lines)
|
||||
Version 16.231.4: May 31, 2017 Changes in layout of statistics about institutions.
|
||||
Fixed bug in search. (221039 lines)
|
||||
Version 16.231.3: May 31, 2017 Changes in layout of statistics about institutions. (221037 lines)
|
||||
|
|
|
@ -1647,13 +1647,13 @@ static void Cty_PutParamOtherCtyCod (long CtyCod)
|
|||
/******************* Get parameter with code of country **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
long Cty_GetAndCheckParamOtherCtyCod (void)
|
||||
long Cty_GetAndCheckParamOtherCtyCod (long MinCodAllowed)
|
||||
{
|
||||
long CtyCod;
|
||||
|
||||
/***** Get and check parameter with code of country *****/
|
||||
if ((CtyCod = Cty_GetParamOtherCtyCod ()) < 0)
|
||||
Lay_ShowErrorAndExit ("Code of country is missing.");
|
||||
if ((CtyCod = Cty_GetParamOtherCtyCod ()) < MinCodAllowed)
|
||||
Lay_ShowErrorAndExit ("Code of country is missing or invalid.");
|
||||
|
||||
return CtyCod;
|
||||
}
|
||||
|
@ -1676,7 +1676,7 @@ void Cty_RemoveCountry (void)
|
|||
struct Country Cty;
|
||||
|
||||
/***** Get country code *****/
|
||||
Cty.CtyCod = Cty_GetAndCheckParamOtherCtyCod ();
|
||||
Cty.CtyCod = Cty_GetAndCheckParamOtherCtyCod (0);
|
||||
|
||||
/***** Get data of the country from database *****/
|
||||
Cty_GetDataOfCountryByCod (&Cty,Cty_GET_EXTRA_DATA);
|
||||
|
@ -1724,14 +1724,13 @@ void Cty_RenameCountry (void)
|
|||
|
||||
Cty = &Gbl.Ctys.EditingCty;
|
||||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get the code of the country */
|
||||
Cty->CtyCod = Cty_GetAndCheckParamOtherCtyCod ();
|
||||
/***** Get the code of the country *****/
|
||||
Cty->CtyCod = Cty_GetAndCheckParamOtherCtyCod (0);
|
||||
|
||||
/* Get the lenguage */
|
||||
/***** Get the lenguage *****/
|
||||
Language = Lan_GetParamLanguage ();
|
||||
|
||||
/* Get the new name for the country */
|
||||
/***** Get the new name for the country *****/
|
||||
Par_GetParToText ("Name",NewCtyName,Cty_MAX_BYTES_NAME);
|
||||
|
||||
/***** Get from the database the data of the country *****/
|
||||
|
@ -1766,6 +1765,10 @@ void Cty_RenameCountry (void)
|
|||
sprintf (Gbl.Alert.Txt,Txt_The_country_X_has_been_renamed_as_Y,
|
||||
Cty->Name[Language],NewCtyName);
|
||||
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
|
||||
|
||||
/* Update country name */
|
||||
Str_Copy (Cty->Name[Language],NewCtyName,
|
||||
Cty_MAX_BYTES_NAME);
|
||||
}
|
||||
}
|
||||
else // The same name
|
||||
|
@ -1777,8 +1780,6 @@ void Cty_RenameCountry (void)
|
|||
}
|
||||
|
||||
/***** Show the form again *****/
|
||||
Str_Copy (Cty->Name[Language],NewCtyName,
|
||||
Cty_MAX_BYTES_NAME);
|
||||
Cty_EditCountries ();
|
||||
}
|
||||
|
||||
|
@ -1855,14 +1856,13 @@ void Cty_ChangeCtyWWW (void)
|
|||
|
||||
Cty = &Gbl.Ctys.EditingCty;
|
||||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get the code of the country */
|
||||
Cty->CtyCod = Cty_GetAndCheckParamOtherCtyCod ();
|
||||
/***** Get the code of the country *****/
|
||||
Cty->CtyCod = Cty_GetAndCheckParamOtherCtyCod (0);
|
||||
|
||||
/* Get the lenguage */
|
||||
/***** Get the lenguage *****/
|
||||
Language = Lan_GetParamLanguage ();
|
||||
|
||||
/* Get the new WWW for the country */
|
||||
/***** Get the new WWW for the country *****/
|
||||
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||
|
||||
/***** Get from the database the data of the country *****/
|
||||
|
@ -1873,14 +1873,14 @@ void Cty_ChangeCtyWWW (void)
|
|||
" WHERE CtyCod='%03ld'",
|
||||
Txt_STR_LANG_ID[Language],NewWWW,Cty->CtyCod);
|
||||
DB_QueryUPDATE (Query,"can not update the web of a country");
|
||||
Str_Copy (Cty->WWW[Language],NewWWW,
|
||||
Cns_MAX_BYTES_WWW);
|
||||
|
||||
/***** Write message to show the change made *****/
|
||||
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
|
||||
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
|
||||
|
||||
/***** Show the form again *****/
|
||||
Str_Copy (Cty->WWW[Language],NewWWW,
|
||||
Cns_MAX_BYTES_WWW);
|
||||
Cty_EditCountries ();
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ void Cty_WriteCountryName (long CtyCod,const char *ClassLink);
|
|||
bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraData);
|
||||
void Cty_GetCountryName (long CtyCod,char CtyName[Cty_MAX_BYTES_NAME + 1]);
|
||||
void Cty_PutParamCtyCod (long CtyCod);
|
||||
long Cty_GetAndCheckParamOtherCtyCod (void);
|
||||
long Cty_GetAndCheckParamOtherCtyCod (long MinCodAllowed);
|
||||
void Cty_RemoveCountry (void);
|
||||
void Cty_RenameCountry (void);
|
||||
void Cty_ChangeCtyWWW (void);
|
||||
|
|
|
@ -122,7 +122,7 @@ static void Crs_PutLinkToSearchCourses (void);
|
|||
static void Sch_PutLinkToSearchCoursesParams (void);
|
||||
|
||||
static void Crs_PutParamOtherCrsCod (long CrsCod);
|
||||
static long Crs_GetAndCheckParamOtherCrsCod (void);
|
||||
static long Crs_GetAndCheckParamOtherCrsCod (long MinCodAllowed);
|
||||
|
||||
static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnAccepted);
|
||||
|
||||
|
@ -1948,7 +1948,7 @@ void Crs_RemoveCourse (void)
|
|||
struct Course Crs;
|
||||
|
||||
/***** Get course code *****/
|
||||
Crs.CrsCod = Crs_GetAndCheckParamOtherCrsCod ();
|
||||
Crs.CrsCod = Crs_GetAndCheckParamOtherCrsCod (1);
|
||||
|
||||
/***** Get data of the course from database *****/
|
||||
Crs_GetDataOfCourseByCod (&Crs);
|
||||
|
@ -2113,6 +2113,8 @@ void Crs_RemoveCourseCompletely (long CrsCod)
|
|||
{
|
||||
char Query[128];
|
||||
|
||||
if (CrsCod > 0)
|
||||
{
|
||||
/***** Empty course *****/
|
||||
Crs_EmptyCourseCompletely (CrsCod);
|
||||
|
||||
|
@ -2124,6 +2126,7 @@ void Crs_RemoveCourseCompletely (long CrsCod)
|
|||
sprintf (Query,"DELETE FROM courses WHERE CrsCod=%ld",CrsCod);
|
||||
DB_QueryDELETE (Query,"can not remove a course");
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********** Empty a course (remove all its information and users) ************/
|
||||
|
@ -2137,6 +2140,8 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
|
|||
char PathRelCrs[PATH_MAX + 1];
|
||||
char Query[512];
|
||||
|
||||
if (CrsCod > 0)
|
||||
{
|
||||
/***** Get course data *****/
|
||||
Crs.CrsCod = CrsCod;
|
||||
Crs_GetDataOfCourseByCod (&Crs);
|
||||
|
@ -2254,6 +2259,7 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
|
|||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CRS,CrsCod);
|
||||
Fil_RemoveTree (PathRelCrs);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***** Change the institutional code of a course in course configuration *****/
|
||||
|
@ -2295,7 +2301,7 @@ void Crs_ChangeInsCrsCod (void)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get course code */
|
||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod ();
|
||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod (1);
|
||||
|
||||
/* Get institutional code */
|
||||
Par_GetParToText ("InsCrsCod",NewInstitutionalCrsCod,Crs_MAX_BYTES_INSTITUTIONAL_CRS_COD);
|
||||
|
@ -2339,7 +2345,7 @@ void Crs_ChangeCrsDegInConfig (void)
|
|||
struct Degree NewDeg;
|
||||
|
||||
/***** Get parameter with degree code *****/
|
||||
NewDeg.DegCod = Deg_GetAndCheckParamOtherDegCod ();
|
||||
NewDeg.DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||
|
||||
/***** Check if degree has changed *****/
|
||||
if (NewDeg.DegCod != Gbl.CurrentCrs.Crs.DegCod)
|
||||
|
@ -2477,7 +2483,7 @@ void Crs_ChangeCrsYear (void)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get course code */
|
||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod ();
|
||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod (1);
|
||||
|
||||
/* Get parameter with year */
|
||||
Par_GetParToText ("OthCrsYear",YearStr,2);
|
||||
|
@ -2572,7 +2578,7 @@ void Crs_UpdateInstitutionalCrsCod (struct Course *Crs,const char *NewInstitutio
|
|||
|
||||
void Crs_RenameCourseShort (void)
|
||||
{
|
||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod ();
|
||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod (1);
|
||||
Crs_RenameCourse (&Gbl.Degs.EditingCrs,Cns_SHRT_NAME);
|
||||
}
|
||||
|
||||
|
@ -2587,7 +2593,7 @@ void Crs_RenameCourseShortInConfig (void)
|
|||
|
||||
void Crs_RenameCourseFull (void)
|
||||
{
|
||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod ();
|
||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod (1);
|
||||
Crs_RenameCourse (&Gbl.Degs.EditingCrs,Cns_FULL_NAME);
|
||||
}
|
||||
|
||||
|
@ -2732,7 +2738,7 @@ void Crs_ChangeCrsStatus (void)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get course code */
|
||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod ();
|
||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod (1);
|
||||
|
||||
/* Get parameter with status */
|
||||
Status = (Crs_Status_t)
|
||||
|
@ -2938,13 +2944,13 @@ static void Crs_PutParamOtherCrsCod (long CrsCod)
|
|||
/********************* Get parameter with code of course *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static long Crs_GetAndCheckParamOtherCrsCod (void)
|
||||
static long Crs_GetAndCheckParamOtherCrsCod (long MinCodAllowed)
|
||||
{
|
||||
long CrsCod;
|
||||
|
||||
/***** Get and check parameter with code of course *****/
|
||||
if ((CrsCod = Par_GetParToLong ("OthCrsCod")) <= 0)
|
||||
Lay_ShowErrorAndExit ("Code of course is missing.");
|
||||
if ((CrsCod = Par_GetParToLong ("OthCrsCod")) < MinCodAllowed)
|
||||
Lay_ShowErrorAndExit ("Code of course is missing or invalid.");
|
||||
|
||||
return CrsCod;
|
||||
}
|
||||
|
|
|
@ -1543,8 +1543,7 @@ static void Deg_RecFormRequestOrCreateDeg (unsigned Status)
|
|||
Par_GetParToText ("FullName",Gbl.Degs.EditingDeg.FullName,Hie_MAX_BYTES_FULL_NAME);
|
||||
|
||||
/* Get degree type */
|
||||
if ((Gbl.Degs.EditingDeg.DegTypCod = DT_GetParamOtherDegTypCod ()) <= 0)
|
||||
Ale_ShowAlert (Ale_ERROR,"Wrong type of degree.");
|
||||
Gbl.Degs.EditingDeg.DegTypCod = DT_GetAndCheckParamOtherDegTypCod (1);
|
||||
|
||||
/* Get degree WWW */
|
||||
Par_GetParToText ("WWW",Gbl.Degs.EditingDeg.WWW,Cns_MAX_BYTES_WWW);
|
||||
|
@ -1597,7 +1596,7 @@ void Deg_RemoveDegree (void)
|
|||
struct Degree Deg;
|
||||
|
||||
/***** Get degree code *****/
|
||||
Deg.DegCod = Deg_GetAndCheckParamOtherDegCod ();
|
||||
Deg.DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||
|
||||
/***** Get data of degree *****/
|
||||
Deg_GetDataOfDegreeByCod (&Deg);
|
||||
|
@ -1642,13 +1641,13 @@ static void Deg_PutParamOtherDegCod (long DegCod)
|
|||
/********************* Get parameter with code of degree *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
long Deg_GetAndCheckParamOtherDegCod (void)
|
||||
long Deg_GetAndCheckParamOtherDegCod (long MinCodAllowed)
|
||||
{
|
||||
long DegCod;
|
||||
|
||||
/***** Get and check parameter with code of degree *****/
|
||||
if ((DegCod = Par_GetParToLong ("OthDegCod")) <= 0)
|
||||
Lay_ShowErrorAndExit ("Code of degree is missing.");
|
||||
if ((DegCod = Par_GetParToLong ("OthDegCod")) < MinCodAllowed)
|
||||
Lay_ShowErrorAndExit ("Code of degree is missing or invalid.");
|
||||
|
||||
return DegCod;
|
||||
}
|
||||
|
@ -1902,7 +1901,7 @@ void Deg_RemoveDegreeCompletely (long DegCod)
|
|||
|
||||
void Deg_RenameDegreeShort (void)
|
||||
{
|
||||
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod ();
|
||||
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||
Deg_RenameDegree (&Gbl.Degs.EditingDeg,Cns_SHRT_NAME);
|
||||
}
|
||||
|
||||
|
@ -1917,7 +1916,7 @@ void Deg_RenameDegreeShortInConfig (void)
|
|||
|
||||
void Deg_RenameDegreeFull (void)
|
||||
{
|
||||
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod ();
|
||||
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||
Deg_RenameDegree (&Gbl.Degs.EditingDeg,Cns_FULL_NAME);
|
||||
}
|
||||
|
||||
|
@ -2047,7 +2046,7 @@ void Deg_ChangeDegCtrInConfig (void)
|
|||
struct Centre NewCtr;
|
||||
|
||||
/***** Get parameter with centre code *****/
|
||||
NewCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
||||
NewCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||
|
||||
/***** Check if centre has changed *****/
|
||||
if (NewCtr.CtrCod != Gbl.CurrentDeg.Deg.CtrCod)
|
||||
|
@ -2126,7 +2125,7 @@ void Deg_ChangeDegWWW (void)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get the code of the degree */
|
||||
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod ();
|
||||
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||
|
||||
/* Get the new WWW for the degree */
|
||||
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||
|
@ -2211,7 +2210,7 @@ void Deg_ChangeDegStatus (void)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get degree code */
|
||||
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod ();
|
||||
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||
|
||||
/* Get parameter with status */
|
||||
Status = (Deg_Status_t)
|
||||
|
|
|
@ -112,7 +112,7 @@ void Deg_RecFormNewDeg (void);
|
|||
void Deg_RemoveDegree (void);
|
||||
|
||||
void Deg_PutParamDegCod (long DegCod);
|
||||
long Deg_GetAndCheckParamOtherDegCod (void);
|
||||
long Deg_GetAndCheckParamOtherDegCod (long MinCodAllowed);
|
||||
|
||||
bool Deg_GetDataOfDegreeByCod (struct Degree *Deg);
|
||||
void Deg_GetShortNameOfDegreeByCod (struct Degree *Deg);
|
||||
|
|
|
@ -746,8 +746,7 @@ void DT_RemoveDegreeType (void)
|
|||
struct DegreeType DegTyp;
|
||||
|
||||
/***** Get the code of the degree type *****/
|
||||
if ((DegTyp.DegTypCod = DT_GetParamOtherDegTypCod ()) == -1L)
|
||||
Lay_ShowErrorAndExit ("Code of type of degree is missing.");
|
||||
DegTyp.DegTypCod = DT_GetAndCheckParamOtherDegTypCod (1);
|
||||
|
||||
/***** Get data of the degree type from database *****/
|
||||
if (!DT_GetDataOfDegreeTypeByCod (&DegTyp))
|
||||
|
@ -784,10 +783,15 @@ static void DT_PutParamOtherDegTypCod (long DegTypCod)
|
|||
/******************* Get parameter with code of degree type ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
long DT_GetParamOtherDegTypCod (void)
|
||||
long DT_GetAndCheckParamOtherDegTypCod (long MinCodAllowed)
|
||||
{
|
||||
/***** Get code of degree type *****/
|
||||
return Par_GetParToLong ("OthDegTypCod");
|
||||
long DegTypCod;
|
||||
|
||||
/***** Get and check parameter with code of degree type *****/
|
||||
if ((DegTypCod = Par_GetParToLong ("OthDegTypCod")) < MinCodAllowed)
|
||||
Lay_ShowErrorAndExit ("Code of degree type is missing or invalid.");
|
||||
|
||||
return DegTypCod;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -919,8 +923,7 @@ void DT_RenameDegreeType (void)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get the code of the degree type */
|
||||
if ((DegTyp->DegTypCod = DT_GetParamOtherDegTypCod ()) == -1L)
|
||||
Lay_ShowErrorAndExit ("Code of type of degree is missing.");
|
||||
DegTyp->DegTypCod = DT_GetAndCheckParamOtherDegTypCod (1);
|
||||
|
||||
/* Get the new name for the degree type */
|
||||
Par_GetParToText ("DegTypName",NewNameDegTyp,Deg_MAX_BYTES_DEGREE_TYPE_NAME);
|
||||
|
@ -1003,10 +1006,10 @@ void DT_ChangeDegreeType (void)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get degree code */
|
||||
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod ();
|
||||
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||
|
||||
/* Get the new degree type */
|
||||
NewDegTypCod = DT_GetParamOtherDegTypCod ();
|
||||
NewDegTypCod = DT_GetAndCheckParamOtherDegTypCod (1);
|
||||
|
||||
/***** Get data of degree *****/
|
||||
Deg_GetDataOfDegreeByCod (&Gbl.Degs.EditingDeg);
|
||||
|
|
|
@ -74,7 +74,7 @@ void DT_RecFormNewDegreeType (void);
|
|||
|
||||
void DT_RemoveDegreeType (void);
|
||||
|
||||
long DT_GetParamOtherDegTypCod (void);
|
||||
long DT_GetAndCheckParamOtherDegTypCod (long MinCodAllowed);
|
||||
|
||||
bool DT_GetDataOfDegreeTypeByCod (struct DegreeType *DegTyp);
|
||||
void DT_RenameDegreeType (void);
|
||||
|
|
|
@ -601,13 +601,18 @@ static void Dpt_PutParamDptCod (long DptCod)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* Get parameter with code of degree type ******************/
|
||||
/******************* Get parameter with code of department *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
long Dpt_GetParamDptCod (void)
|
||||
long Dpt_GetAndCheckParamDptCod (long MinCodAllowed)
|
||||
{
|
||||
/***** Get code of department *****/
|
||||
return Par_GetParToLong ("DptCod");
|
||||
long DptCod;
|
||||
|
||||
/***** Get and check parameter with code of department *****/
|
||||
if ((DptCod = Par_GetParToLong ("DptCod")) < MinCodAllowed)
|
||||
Lay_ShowErrorAndExit ("Code of department is missing or invalid.");
|
||||
|
||||
return DptCod;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -622,8 +627,7 @@ void Dpt_RemoveDepartment (void)
|
|||
struct Department Dpt;
|
||||
|
||||
/***** Get department code *****/
|
||||
if ((Dpt.DptCod = Dpt_GetParamDptCod ()) == -1L)
|
||||
Lay_ShowErrorAndExit ("Code of department is missing.");
|
||||
Dpt.DptCod = Dpt_GetAndCheckParamDptCod (1);
|
||||
|
||||
/***** Get data of the department from database *****/
|
||||
Dpt_GetDataOfDepartmentByCod (&Dpt);
|
||||
|
@ -661,11 +665,10 @@ void Dpt_ChangeDepartIns (void)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get the code of the department */
|
||||
if ((Dpt->DptCod = Dpt_GetParamDptCod ()) == -1L)
|
||||
Lay_ShowErrorAndExit ("Code of department is missing.");
|
||||
Dpt->DptCod = Dpt_GetAndCheckParamDptCod (1);
|
||||
|
||||
/* Get parameter with institution code */
|
||||
Dpt->InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
||||
Dpt->InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||
|
||||
/***** Update institution in table of departments *****/
|
||||
sprintf (Query,"UPDATE departments SET InsCod=%ld WHERE DptCod=%ld",
|
||||
|
@ -733,8 +736,7 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get the code of the department */
|
||||
if ((Dpt->DptCod = Dpt_GetParamDptCod ()) == -1L)
|
||||
Lay_ShowErrorAndExit ("Code of department is missing.");
|
||||
Dpt->DptCod = Dpt_GetAndCheckParamDptCod (1);
|
||||
|
||||
/* Get the new name for the department */
|
||||
Par_GetParToText (ParamName,NewDptName,MaxBytes);
|
||||
|
@ -831,8 +833,7 @@ void Dpt_ChangeDptWWW (void)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get the code of the department */
|
||||
if ((Dpt->DptCod = Dpt_GetParamDptCod ()) == -1L)
|
||||
Lay_ShowErrorAndExit ("Code of department is missing.");
|
||||
Dpt->DptCod = Dpt_GetAndCheckParamDptCod (1);
|
||||
|
||||
/* Get the new WWW for the department */
|
||||
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||
|
@ -1020,7 +1021,7 @@ void Dpt_RecFormNewDpt (void)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get institution */
|
||||
Dpt->InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
||||
Dpt->InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||
|
||||
/* Get department short name */
|
||||
Par_GetParToText ("ShortName",Dpt->ShrtName,Hie_MAX_BYTES_SHRT_NAME);
|
||||
|
|
|
@ -61,7 +61,7 @@ void Dpt_GetListDepartments (long InsCod);
|
|||
void Dpt_FreeListDepartments (void);
|
||||
unsigned Dpt_GetNumDepartmentsInInstitution (long InsCod);
|
||||
void Dpt_GetDataOfDepartmentByCod (struct Department *Dpt);
|
||||
long Dpt_GetParamDptCod (void);
|
||||
long Dpt_GetAndCheckParamDptCod (long MinCodAllowed);
|
||||
void Dpt_RemoveDepartment (void);
|
||||
void Dpt_ChangeDepartIns (void);
|
||||
void Dpt_RenameDepartShort (void);
|
||||
|
|
|
@ -222,11 +222,12 @@ static void Ind_GetParamsIndicators (void)
|
|||
Sco_GetScope ("ScopeInd");
|
||||
|
||||
/***** Get degree type code *****/
|
||||
Gbl.Stat.DegTypCod = (Gbl.Scope.Current == Sco_SCOPE_SYS) ? DT_GetParamOtherDegTypCod () :
|
||||
Gbl.Stat.DegTypCod = (Gbl.Scope.Current == Sco_SCOPE_SYS) ?
|
||||
DT_GetAndCheckParamOtherDegTypCod (-1L) : // -1L (any degree type) is allowed here
|
||||
-1L;
|
||||
|
||||
/***** Get department code *****/
|
||||
Gbl.Stat.DptCod = Dpt_GetParamDptCod ();
|
||||
Gbl.Stat.DptCod = Dpt_GetAndCheckParamDptCod (-1L); // -1L (any department) is allowed here
|
||||
|
||||
/***** Get number of indicators *****/
|
||||
Ind_GetParamNumIndicators ();
|
||||
|
|
|
@ -1641,13 +1641,13 @@ static void Ins_PutParamOtherInsCod (long InsCod)
|
|||
/******************* Get parameter with code of institution ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
long Ins_GetAndCheckParamOtherInsCod (void)
|
||||
long Ins_GetAndCheckParamOtherInsCod (long MinCodAllowed)
|
||||
{
|
||||
long InsCod;
|
||||
|
||||
/***** Get and check parameter with code of institution *****/
|
||||
if ((InsCod = Ins_GetParamOtherInsCod ()) < 0)
|
||||
Lay_ShowErrorAndExit ("Code of institution is missing.");
|
||||
if ((InsCod = Ins_GetParamOtherInsCod ()) < MinCodAllowed)
|
||||
Lay_ShowErrorAndExit ("Code of institution is missing or invalid.");
|
||||
|
||||
return InsCod;
|
||||
}
|
||||
|
@ -1671,7 +1671,7 @@ void Ins_RemoveInstitution (void)
|
|||
char PathIns[PATH_MAX + 1];
|
||||
|
||||
/***** Get institution code *****/
|
||||
Ins.InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
||||
Ins.InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||
|
||||
/***** Get data of the institution from database *****/
|
||||
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_EXTRA_DATA);
|
||||
|
@ -1722,7 +1722,7 @@ void Ins_RemoveInstitution (void)
|
|||
|
||||
void Ins_RenameInsShort (void)
|
||||
{
|
||||
Gbl.Inss.EditingIns.InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
||||
Gbl.Inss.EditingIns.InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||
Ins_RenameInstitution (&Gbl.Inss.EditingIns,Cns_SHRT_NAME);
|
||||
}
|
||||
|
||||
|
@ -1737,7 +1737,7 @@ void Ins_RenameInsShortInConfig (void)
|
|||
|
||||
void Ins_RenameInsFull (void)
|
||||
{
|
||||
Gbl.Inss.EditingIns.InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
||||
Gbl.Inss.EditingIns.InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||
Ins_RenameInstitution (&Gbl.Inss.EditingIns,Cns_FULL_NAME);
|
||||
}
|
||||
|
||||
|
@ -1867,7 +1867,7 @@ void Ins_ChangeInsCtyInConfig (void)
|
|||
struct Country NewCty;
|
||||
|
||||
/***** Get the new country code for the institution *****/
|
||||
NewCty.CtyCod = Cty_GetAndCheckParamOtherCtyCod ();
|
||||
NewCty.CtyCod = Cty_GetAndCheckParamOtherCtyCod (0);
|
||||
|
||||
/***** Check if country has changed *****/
|
||||
if (NewCty.CtyCod != Gbl.CurrentIns.Ins.CtyCod)
|
||||
|
@ -1945,7 +1945,7 @@ void Ins_ChangeInsWWW (void)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get the code of the institution */
|
||||
Gbl.Inss.EditingIns.InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
||||
Gbl.Inss.EditingIns.InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||
|
||||
/* Get the new WWW for the institution */
|
||||
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||
|
@ -2030,7 +2030,7 @@ void Ins_ChangeInsStatus (void)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get institution code */
|
||||
Gbl.Inss.EditingIns.InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
||||
Gbl.Inss.EditingIns.InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||
|
||||
/* Get parameter with status */
|
||||
Status = (Ins_Status_t)
|
||||
|
|
|
@ -111,7 +111,7 @@ void Ins_GetShortNameOfInstitutionByCod (struct Instit *Ins);
|
|||
void Ins_FreeListInstitutions (void);
|
||||
void Ins_WriteSelectorOfInstitution (void);
|
||||
void Ins_PutParamInsCod (long InsCod);
|
||||
long Ins_GetAndCheckParamOtherInsCod (void);
|
||||
long Ins_GetAndCheckParamOtherInsCod (long MinCodAllowed);
|
||||
void Ins_RemoveInstitution (void);
|
||||
void Ins_RenameInsShort (void);
|
||||
void Ins_RenameInsShortInConfig (void);
|
||||
|
|
|
@ -1334,7 +1334,7 @@ void Pho_CalcPhotoDegree (void)
|
|||
Fil_RemoveOldTmpFiles (PathPhotosTmpPriv,Cfg_TIME_TO_DELETE_PHOTOS_TMP_FILES,false);
|
||||
|
||||
/***** Get the degree which photo will be computed *****/
|
||||
DegCod = Deg_GetAndCheckParamOtherDegCod ();
|
||||
DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||
|
||||
/***** Prevent the computing of an average photo too recently updated *****/
|
||||
if (Pho_GetTimeAvgPhotoWasComputed (DegCod) >=
|
||||
|
|
|
@ -4249,7 +4249,7 @@ void Rec_ShowFormMyInsCtrDpt (void)
|
|||
void Rec_ChgCountryOfMyInstitution (void)
|
||||
{
|
||||
/***** Get country code of my institution *****/
|
||||
Gbl.Usrs.Me.UsrDat.InsCtyCod = Cty_GetAndCheckParamOtherCtyCod ();
|
||||
Gbl.Usrs.Me.UsrDat.InsCtyCod = Cty_GetAndCheckParamOtherCtyCod (0);
|
||||
|
||||
/***** Update institution, centre and department *****/
|
||||
// When country changes, the institution, centre and department must be reset
|
||||
|
@ -4272,7 +4272,7 @@ void Rec_UpdateMyInstitution (void)
|
|||
|
||||
/***** Get my institution *****/
|
||||
/* Get institution code */
|
||||
Ins.InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
||||
Ins.InsCod = Ins_GetAndCheckParamOtherInsCod (0); // 0 (another institution) is allowed here
|
||||
|
||||
/* Get country of institution */
|
||||
if (Ins.InsCod > 0)
|
||||
|
@ -4302,7 +4302,7 @@ void Rec_UpdateMyCentre (void)
|
|||
|
||||
/***** Get my centre *****/
|
||||
/* Get centre code */
|
||||
Ctr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
||||
Ctr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (0); // 0 (another centre) is allowed here
|
||||
|
||||
/* Get institution of centre */
|
||||
if (Ctr.CtrCod > 0)
|
||||
|
@ -4333,8 +4333,7 @@ void Rec_UpdateMyDepartment (void)
|
|||
|
||||
/***** Get my department *****/
|
||||
/* Get department code */
|
||||
if ((Dpt.DptCod = Dpt_GetParamDptCod ()) < 0)
|
||||
Lay_ShowErrorAndExit ("Code of department is missing.");
|
||||
Dpt.DptCod = Dpt_GetAndCheckParamDptCod (0); // 0 (another department) is allowed here
|
||||
|
||||
/* Get institution of department */
|
||||
if (Dpt.DptCod > 0)
|
||||
|
|
Loading…
Reference in New Issue