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 ******************/
|
/****************** Get parameter with code of other centre ******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
long Ctr_GetAndCheckParamOtherCtrCod (void)
|
long Ctr_GetAndCheckParamOtherCtrCod (long MinCodAllowed)
|
||||||
{
|
{
|
||||||
long CtrCod;
|
long CtrCod;
|
||||||
|
|
||||||
/***** Get and check parameter with code of centre *****/
|
/***** Get and check parameter with code of centre *****/
|
||||||
if ((CtrCod = Par_GetParToLong ("OthCtrCod")) <= 0)
|
if ((CtrCod = Par_GetParToLong ("OthCtrCod")) < MinCodAllowed)
|
||||||
Lay_ShowErrorAndExit ("Code of centre is missing.");
|
Lay_ShowErrorAndExit ("Code of centre is missing or invalid.");
|
||||||
|
|
||||||
return CtrCod;
|
return CtrCod;
|
||||||
}
|
}
|
||||||
|
@ -1698,7 +1698,7 @@ void Ctr_RemoveCentre (void)
|
||||||
char PathCtr[PATH_MAX + 1];
|
char PathCtr[PATH_MAX + 1];
|
||||||
|
|
||||||
/***** Get centre code *****/
|
/***** Get centre code *****/
|
||||||
Ctr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
Ctr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||||
|
|
||||||
/***** Get data of the centre from database *****/
|
/***** Get data of the centre from database *****/
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
|
@ -1728,12 +1728,12 @@ void Ctr_RemoveCentre (void)
|
||||||
|
|
||||||
/***** Remove centre *****/
|
/***** Remove centre *****/
|
||||||
sprintf (Query,"DELETE FROM centres WHERE CtrCod=%ld",
|
sprintf (Query,"DELETE FROM centres WHERE CtrCod=%ld",
|
||||||
Ctr.CtrCod);
|
Ctr.CtrCod);
|
||||||
DB_QueryDELETE (Query,"can not remove a centre");
|
DB_QueryDELETE (Query,"can not remove a centre");
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Write message to show the change made *****/
|
||||||
sprintf (Gbl.Alert.Txt,Txt_Centre_X_removed,
|
sprintf (Gbl.Alert.Txt,Txt_Centre_X_removed,
|
||||||
Ctr.FullName);
|
Ctr.FullName);
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
|
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1752,7 +1752,7 @@ void Ctr_ChangeCtrInsInConfig (void)
|
||||||
struct Instit NewIns;
|
struct Instit NewIns;
|
||||||
|
|
||||||
/***** Get parameter with institution code *****/
|
/***** Get parameter with institution code *****/
|
||||||
NewIns.InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
NewIns.InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||||
|
|
||||||
/***** Check if institution has changed *****/
|
/***** Check if institution has changed *****/
|
||||||
if (NewIns.InsCod != Gbl.CurrentCtr.Ctr.InsCod)
|
if (NewIns.InsCod != Gbl.CurrentCtr.Ctr.InsCod)
|
||||||
|
@ -1834,11 +1834,10 @@ void Ctr_ChangeCentrePlace (void)
|
||||||
long NewPlcCod;
|
long NewPlcCod;
|
||||||
char Query[512];
|
char Query[512];
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get centre code *****/
|
||||||
/* Get centre code */
|
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
|
||||||
|
|
||||||
/* Get parameter with centre code */
|
/***** Get parameter with place code *****/
|
||||||
NewPlcCod = Plc_GetParamPlcCod ();
|
NewPlcCod = Plc_GetParamPlcCod ();
|
||||||
|
|
||||||
/***** Get data of centre from database *****/
|
/***** Get data of centre from database *****/
|
||||||
|
@ -1846,12 +1845,12 @@ void Ctr_ChangeCentrePlace (void)
|
||||||
|
|
||||||
/***** Update place in table of centres *****/
|
/***** Update place in table of centres *****/
|
||||||
sprintf (Query,"UPDATE centres SET PlcCod=%ld WHERE CtrCod=%ld",
|
sprintf (Query,"UPDATE centres SET PlcCod=%ld WHERE CtrCod=%ld",
|
||||||
NewPlcCod,Gbl.Ctrs.EditingCtr.CtrCod);
|
NewPlcCod,Gbl.Ctrs.EditingCtr.CtrCod);
|
||||||
DB_QueryUPDATE (Query,"can not update the place of a centre");
|
DB_QueryUPDATE (Query,"can not update the place of a centre");
|
||||||
Gbl.Ctrs.EditingCtr.PlcCod = NewPlcCod;
|
Gbl.Ctrs.EditingCtr.PlcCod = NewPlcCod;
|
||||||
|
|
||||||
/***** Write message to show the change made
|
/***** Write message to show the change made
|
||||||
and put button to go to centre changed *****/
|
and put button to go to centre changed *****/
|
||||||
Gbl.Alert.Type = Ale_SUCCESS;
|
Gbl.Alert.Type = Ale_SUCCESS;
|
||||||
sprintf (Gbl.Alert.Txt,"%s",Txt_The_place_of_the_centre_has_changed);
|
sprintf (Gbl.Alert.Txt,"%s",Txt_The_place_of_the_centre_has_changed);
|
||||||
Ctr_ShowAlertAndButtonToGoToCtr ();
|
Ctr_ShowAlertAndButtonToGoToCtr ();
|
||||||
|
@ -1866,7 +1865,7 @@ void Ctr_ChangeCentrePlace (void)
|
||||||
|
|
||||||
void Ctr_RenameCentreShort (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);
|
Ctr_RenameCentre (&Gbl.Ctrs.EditingCtr,Cns_SHRT_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1881,7 +1880,7 @@ void Ctr_RenameCentreShortInConfig (void)
|
||||||
|
|
||||||
void Ctr_RenameCentreFull (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);
|
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;
|
extern const char *Txt_You_can_not_leave_the_web_address_empty;
|
||||||
char NewWWW[Cns_MAX_BYTES_WWW + 1];
|
char NewWWW[Cns_MAX_BYTES_WWW + 1];
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get the code of the centre *****/
|
||||||
/* Get the code of the centre */
|
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
|
||||||
|
|
||||||
/* Get the new WWW for the centre */
|
/***** Get the new WWW for the centre *****/
|
||||||
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||||
|
|
||||||
/***** Get data of centre *****/
|
/***** Get data of centre *****/
|
||||||
|
@ -2026,7 +2024,7 @@ void Ctr_ChangeCtrWWW (void)
|
||||||
/***** Update database changing old WWW by new WWW *****/
|
/***** Update database changing old WWW by new WWW *****/
|
||||||
Ctr_UpdateCtrWWWDB (Gbl.Ctrs.EditingCtr.CtrCod,NewWWW);
|
Ctr_UpdateCtrWWWDB (Gbl.Ctrs.EditingCtr.CtrCod,NewWWW);
|
||||||
Str_Copy (Gbl.Ctrs.EditingCtr.WWW,NewWWW,
|
Str_Copy (Gbl.Ctrs.EditingCtr.WWW,NewWWW,
|
||||||
Cns_MAX_BYTES_WWW);
|
Cns_MAX_BYTES_WWW);
|
||||||
|
|
||||||
/***** Write message to show the change made
|
/***** Write message to show the change made
|
||||||
and put button to go to centre changed *****/
|
and put button to go to centre changed *****/
|
||||||
|
@ -2096,16 +2094,15 @@ void Ctr_ChangeCtrStatus (void)
|
||||||
Ctr_Status_t Status;
|
Ctr_Status_t Status;
|
||||||
Ctr_StatusTxt_t StatusTxt;
|
Ctr_StatusTxt_t StatusTxt;
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get centre code *****/
|
||||||
/* Get centre code */
|
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||||
Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
|
||||||
|
|
||||||
/* Get parameter with status */
|
/***** Get parameter with status *****/
|
||||||
Status = (Ctr_Status_t)
|
Status = (Ctr_Status_t)
|
||||||
Par_GetParToUnsignedLong ("Status",
|
Par_GetParToUnsignedLong ("Status",
|
||||||
0,
|
0,
|
||||||
(unsigned long) Ctr_MAX_STATUS,
|
(unsigned long) Ctr_MAX_STATUS,
|
||||||
(unsigned long) Ctr_WRONG_STATUS);
|
(unsigned long) Ctr_WRONG_STATUS);
|
||||||
if (Status == Ctr_WRONG_STATUS)
|
if (Status == Ctr_WRONG_STATUS)
|
||||||
Lay_ShowErrorAndExit ("Wrong status.");
|
Lay_ShowErrorAndExit ("Wrong status.");
|
||||||
StatusTxt = Ctr_GetStatusTxtFromStatusBits (Status);
|
StatusTxt = Ctr_GetStatusTxtFromStatusBits (Status);
|
||||||
|
@ -2116,7 +2113,7 @@ void Ctr_ChangeCtrStatus (void)
|
||||||
|
|
||||||
/***** Update status in table of centres *****/
|
/***** Update status in table of centres *****/
|
||||||
sprintf (Query,"UPDATE centres SET Status=%u WHERE CtrCod=%ld",
|
sprintf (Query,"UPDATE centres SET Status=%u WHERE CtrCod=%ld",
|
||||||
(unsigned) Status,Gbl.Ctrs.EditingCtr.CtrCod);
|
(unsigned) Status,Gbl.Ctrs.EditingCtr.CtrCod);
|
||||||
DB_QueryUPDATE (Query,"can not update the status of a centre");
|
DB_QueryUPDATE (Query,"can not update the status of a centre");
|
||||||
Gbl.Ctrs.EditingCtr.Status = Status;
|
Gbl.Ctrs.EditingCtr.Status = Status;
|
||||||
|
|
||||||
|
@ -2124,7 +2121,7 @@ void Ctr_ChangeCtrStatus (void)
|
||||||
and put button to go to centre changed *****/
|
and put button to go to centre changed *****/
|
||||||
Gbl.Alert.Type = Ale_SUCCESS;
|
Gbl.Alert.Type = Ale_SUCCESS;
|
||||||
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_centre_X_has_changed,
|
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_centre_X_has_changed,
|
||||||
Gbl.Ctrs.EditingCtr.ShrtName);
|
Gbl.Ctrs.EditingCtr.ShrtName);
|
||||||
Ctr_ShowAlertAndButtonToGoToCtr ();
|
Ctr_ShowAlertAndButtonToGoToCtr ();
|
||||||
|
|
||||||
/***** Show the form again *****/
|
/***** Show the form again *****/
|
||||||
|
|
|
@ -102,7 +102,7 @@ void Ctr_GetShortNameOfCentreByCod (struct Centre *Ctr);
|
||||||
void Ctr_FreeListCentres (void);
|
void Ctr_FreeListCentres (void);
|
||||||
void Ctr_WriteSelectorOfCentre (void);
|
void Ctr_WriteSelectorOfCentre (void);
|
||||||
void Ctr_PutParamCtrCod (long CtrCod);
|
void Ctr_PutParamCtrCod (long CtrCod);
|
||||||
long Ctr_GetAndCheckParamOtherCtrCod (void);
|
long Ctr_GetAndCheckParamOtherCtrCod (long MinCodAllowed);
|
||||||
void Ctr_RemoveCentre (void);
|
void Ctr_RemoveCentre (void);
|
||||||
void Ctr_ChangeCtrInsInConfig (void);
|
void Ctr_ChangeCtrInsInConfig (void);
|
||||||
void Ctr_ContEditAfterChgCtrInConfig (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: 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 *****************************/
|
/****************************** 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 CSS_FILE "swad16.226.css"
|
||||||
#define JS_FILE "swad16.206.3.js"
|
#define JS_FILE "swad16.206.3.js"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// 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
|
// 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.
|
Version 16.231.4: May 31, 2017 Changes in layout of statistics about institutions.
|
||||||
Fixed bug in search. (221039 lines)
|
Fixed bug in search. (221039 lines)
|
||||||
Version 16.231.3: May 31, 2017 Changes in layout of statistics about institutions. (221037 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 **********************/
|
/******************* Get parameter with code of country **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
long Cty_GetAndCheckParamOtherCtyCod (void)
|
long Cty_GetAndCheckParamOtherCtyCod (long MinCodAllowed)
|
||||||
{
|
{
|
||||||
long CtyCod;
|
long CtyCod;
|
||||||
|
|
||||||
/***** Get and check parameter with code of country *****/
|
/***** Get and check parameter with code of country *****/
|
||||||
if ((CtyCod = Cty_GetParamOtherCtyCod ()) < 0)
|
if ((CtyCod = Cty_GetParamOtherCtyCod ()) < MinCodAllowed)
|
||||||
Lay_ShowErrorAndExit ("Code of country is missing.");
|
Lay_ShowErrorAndExit ("Code of country is missing or invalid.");
|
||||||
|
|
||||||
return CtyCod;
|
return CtyCod;
|
||||||
}
|
}
|
||||||
|
@ -1676,7 +1676,7 @@ void Cty_RemoveCountry (void)
|
||||||
struct Country Cty;
|
struct Country Cty;
|
||||||
|
|
||||||
/***** Get country code *****/
|
/***** Get country code *****/
|
||||||
Cty.CtyCod = Cty_GetAndCheckParamOtherCtyCod ();
|
Cty.CtyCod = Cty_GetAndCheckParamOtherCtyCod (0);
|
||||||
|
|
||||||
/***** Get data of the country from database *****/
|
/***** Get data of the country from database *****/
|
||||||
Cty_GetDataOfCountryByCod (&Cty,Cty_GET_EXTRA_DATA);
|
Cty_GetDataOfCountryByCod (&Cty,Cty_GET_EXTRA_DATA);
|
||||||
|
@ -1693,12 +1693,12 @@ void Cty_RemoveCountry (void)
|
||||||
|
|
||||||
/***** Remove country *****/
|
/***** Remove country *****/
|
||||||
sprintf (Query,"DELETE FROM countries WHERE CtyCod='%03ld'",
|
sprintf (Query,"DELETE FROM countries WHERE CtyCod='%03ld'",
|
||||||
Cty.CtyCod);
|
Cty.CtyCod);
|
||||||
DB_QueryDELETE (Query,"can not remove a country");
|
DB_QueryDELETE (Query,"can not remove a country");
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Write message to show the change made *****/
|
||||||
sprintf (Gbl.Alert.Txt,Txt_Country_X_removed,
|
sprintf (Gbl.Alert.Txt,Txt_Country_X_removed,
|
||||||
Cty.Name[Gbl.Prefs.Language]);
|
Cty.Name[Gbl.Prefs.Language]);
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
|
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1724,14 +1724,13 @@ void Cty_RenameCountry (void)
|
||||||
|
|
||||||
Cty = &Gbl.Ctys.EditingCty;
|
Cty = &Gbl.Ctys.EditingCty;
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get the code of the country *****/
|
||||||
/* Get the code of the country */
|
Cty->CtyCod = Cty_GetAndCheckParamOtherCtyCod (0);
|
||||||
Cty->CtyCod = Cty_GetAndCheckParamOtherCtyCod ();
|
|
||||||
|
|
||||||
/* Get the lenguage */
|
/***** Get the lenguage *****/
|
||||||
Language = Lan_GetParamLanguage ();
|
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);
|
Par_GetParToText ("Name",NewCtyName,Cty_MAX_BYTES_NAME);
|
||||||
|
|
||||||
/***** Get from the database the data of the country *****/
|
/***** Get from the database the data of the country *****/
|
||||||
|
@ -1741,44 +1740,46 @@ void Cty_RenameCountry (void)
|
||||||
if (!NewCtyName[0])
|
if (!NewCtyName[0])
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_country_X_empty,
|
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_country_X_empty,
|
||||||
Cty->Name[Language]);
|
Cty->Name[Language]);
|
||||||
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
|
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
|
/***** Check if old and new names are the same (this happens when user press enter with no changes in the form) *****/
|
||||||
if (strcmp (Cty->Name[Language],NewCtyName)) // Different names
|
if (strcmp (Cty->Name[Language],NewCtyName)) // Different names
|
||||||
{
|
{
|
||||||
/***** If country was in database... *****/
|
/***** If country was in database... *****/
|
||||||
if (Cty_CheckIfCountryNameExists (Language,NewCtyName,Cty->CtyCod))
|
if (Cty_CheckIfCountryNameExists (Language,NewCtyName,Cty->CtyCod))
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Alert.Txt,Txt_The_country_X_already_exists,
|
sprintf (Gbl.Alert.Txt,Txt_The_country_X_already_exists,
|
||||||
NewCtyName);
|
NewCtyName);
|
||||||
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
|
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Update the table changing old name by new name */
|
/* Update the table changing old name by new name */
|
||||||
sprintf (FieldName,"Name_%s",Txt_STR_LANG_ID[Language]);
|
sprintf (FieldName,"Name_%s",Txt_STR_LANG_ID[Language]);
|
||||||
Cty_UpdateCtyNameDB (Cty->CtyCod,FieldName,NewCtyName);
|
Cty_UpdateCtyNameDB (Cty->CtyCod,FieldName,NewCtyName);
|
||||||
|
|
||||||
/* Write message to show the change made */
|
/* Write message to show the change made */
|
||||||
sprintf (Gbl.Alert.Txt,Txt_The_country_X_has_been_renamed_as_Y,
|
sprintf (Gbl.Alert.Txt,Txt_The_country_X_has_been_renamed_as_Y,
|
||||||
Cty->Name[Language],NewCtyName);
|
Cty->Name[Language],NewCtyName);
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
|
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
|
||||||
}
|
|
||||||
}
|
/* Update country name */
|
||||||
|
Str_Copy (Cty->Name[Language],NewCtyName,
|
||||||
|
Cty_MAX_BYTES_NAME);
|
||||||
|
}
|
||||||
|
}
|
||||||
else // The same name
|
else // The same name
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_country_X_has_not_changed,
|
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_country_X_has_not_changed,
|
||||||
Cty->Name[Language]);
|
Cty->Name[Language]);
|
||||||
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
|
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Show the form again *****/
|
/***** Show the form again *****/
|
||||||
Str_Copy (Cty->Name[Language],NewCtyName,
|
|
||||||
Cty_MAX_BYTES_NAME);
|
|
||||||
Cty_EditCountries ();
|
Cty_EditCountries ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1855,14 +1856,13 @@ void Cty_ChangeCtyWWW (void)
|
||||||
|
|
||||||
Cty = &Gbl.Ctys.EditingCty;
|
Cty = &Gbl.Ctys.EditingCty;
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get the code of the country *****/
|
||||||
/* Get the code of the country */
|
Cty->CtyCod = Cty_GetAndCheckParamOtherCtyCod (0);
|
||||||
Cty->CtyCod = Cty_GetAndCheckParamOtherCtyCod ();
|
|
||||||
|
|
||||||
/* Get the lenguage */
|
/***** Get the lenguage *****/
|
||||||
Language = Lan_GetParamLanguage ();
|
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);
|
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||||
|
|
||||||
/***** Get from the database the data of the country *****/
|
/***** Get from the database the data of the country *****/
|
||||||
|
@ -1873,14 +1873,14 @@ void Cty_ChangeCtyWWW (void)
|
||||||
" WHERE CtyCod='%03ld'",
|
" WHERE CtyCod='%03ld'",
|
||||||
Txt_STR_LANG_ID[Language],NewWWW,Cty->CtyCod);
|
Txt_STR_LANG_ID[Language],NewWWW,Cty->CtyCod);
|
||||||
DB_QueryUPDATE (Query,"can not update the web of a country");
|
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 *****/
|
/***** Write message to show the change made *****/
|
||||||
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
|
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
|
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
|
||||||
|
|
||||||
/***** Show the form again *****/
|
/***** Show the form again *****/
|
||||||
Str_Copy (Cty->WWW[Language],NewWWW,
|
|
||||||
Cns_MAX_BYTES_WWW);
|
|
||||||
Cty_EditCountries ();
|
Cty_EditCountries ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ void Cty_WriteCountryName (long CtyCod,const char *ClassLink);
|
||||||
bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraData);
|
bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraData);
|
||||||
void Cty_GetCountryName (long CtyCod,char CtyName[Cty_MAX_BYTES_NAME + 1]);
|
void Cty_GetCountryName (long CtyCod,char CtyName[Cty_MAX_BYTES_NAME + 1]);
|
||||||
void Cty_PutParamCtyCod (long CtyCod);
|
void Cty_PutParamCtyCod (long CtyCod);
|
||||||
long Cty_GetAndCheckParamOtherCtyCod (void);
|
long Cty_GetAndCheckParamOtherCtyCod (long MinCodAllowed);
|
||||||
void Cty_RemoveCountry (void);
|
void Cty_RemoveCountry (void);
|
||||||
void Cty_RenameCountry (void);
|
void Cty_RenameCountry (void);
|
||||||
void Cty_ChangeCtyWWW (void);
|
void Cty_ChangeCtyWWW (void);
|
||||||
|
|
232
swad_course.c
232
swad_course.c
|
@ -122,7 +122,7 @@ static void Crs_PutLinkToSearchCourses (void);
|
||||||
static void Sch_PutLinkToSearchCoursesParams (void);
|
static void Sch_PutLinkToSearchCoursesParams (void);
|
||||||
|
|
||||||
static void Crs_PutParamOtherCrsCod (long CrsCod);
|
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);
|
static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnAccepted);
|
||||||
|
|
||||||
|
@ -1948,7 +1948,7 @@ void Crs_RemoveCourse (void)
|
||||||
struct Course Crs;
|
struct Course Crs;
|
||||||
|
|
||||||
/***** Get course code *****/
|
/***** Get course code *****/
|
||||||
Crs.CrsCod = Crs_GetAndCheckParamOtherCrsCod ();
|
Crs.CrsCod = Crs_GetAndCheckParamOtherCrsCod (1);
|
||||||
|
|
||||||
/***** Get data of the course from database *****/
|
/***** Get data of the course from database *****/
|
||||||
Crs_GetDataOfCourseByCod (&Crs);
|
Crs_GetDataOfCourseByCod (&Crs);
|
||||||
|
@ -2113,16 +2113,19 @@ void Crs_RemoveCourseCompletely (long CrsCod)
|
||||||
{
|
{
|
||||||
char Query[128];
|
char Query[128];
|
||||||
|
|
||||||
/***** Empty course *****/
|
if (CrsCod > 0)
|
||||||
Crs_EmptyCourseCompletely (CrsCod);
|
{
|
||||||
|
/***** Empty course *****/
|
||||||
|
Crs_EmptyCourseCompletely (CrsCod);
|
||||||
|
|
||||||
/***** Remove course from table of last accesses to courses in database *****/
|
/***** Remove course from table of last accesses to courses in database *****/
|
||||||
sprintf (Query,"DELETE FROM crs_last WHERE CrsCod=%ld",CrsCod);
|
sprintf (Query,"DELETE FROM crs_last WHERE CrsCod=%ld",CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove a course");
|
DB_QueryDELETE (Query,"can not remove a course");
|
||||||
|
|
||||||
/***** Remove course from table of courses in database *****/
|
/***** Remove course from table of courses in database *****/
|
||||||
sprintf (Query,"DELETE FROM courses WHERE CrsCod=%ld",CrsCod);
|
sprintf (Query,"DELETE FROM courses WHERE CrsCod=%ld",CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove a course");
|
DB_QueryDELETE (Query,"can not remove a course");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2137,122 +2140,125 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
|
||||||
char PathRelCrs[PATH_MAX + 1];
|
char PathRelCrs[PATH_MAX + 1];
|
||||||
char Query[512];
|
char Query[512];
|
||||||
|
|
||||||
/***** Get course data *****/
|
if (CrsCod > 0)
|
||||||
Crs.CrsCod = CrsCod;
|
{
|
||||||
Crs_GetDataOfCourseByCod (&Crs);
|
/***** Get course data *****/
|
||||||
|
Crs.CrsCod = CrsCod;
|
||||||
|
Crs_GetDataOfCourseByCod (&Crs);
|
||||||
|
|
||||||
/***** Remove all the students in the course *****/
|
/***** Remove all the students in the course *****/
|
||||||
Enr_RemAllStdsInCrs (&Crs);
|
Enr_RemAllStdsInCrs (&Crs);
|
||||||
|
|
||||||
/***** Set all the notifications from the course as removed,
|
/***** Set all the notifications from the course as removed,
|
||||||
except notifications about new messages *****/
|
except notifications about new messages *****/
|
||||||
Ntf_MarkNotifInCrsAsRemoved (-1L,CrsCod);
|
Ntf_MarkNotifInCrsAsRemoved (-1L,CrsCod);
|
||||||
|
|
||||||
/***** Remove information of the course ****/
|
/***** Remove information of the course ****/
|
||||||
/* Remove timetable of the course */
|
/* Remove timetable of the course */
|
||||||
sprintf (Query,"DELETE FROM timetable_crs WHERE CrsCod=%ld",CrsCod);
|
sprintf (Query,"DELETE FROM timetable_crs WHERE CrsCod=%ld",CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove the timetable of a course");
|
DB_QueryDELETE (Query,"can not remove the timetable of a course");
|
||||||
|
|
||||||
/* Remove other information of the course */
|
/* Remove other information of the course */
|
||||||
sprintf (Query,"DELETE FROM crs_info_src WHERE CrsCod=%ld",CrsCod);
|
sprintf (Query,"DELETE FROM crs_info_src WHERE CrsCod=%ld",CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove info sources of a course");
|
DB_QueryDELETE (Query,"can not remove info sources of a course");
|
||||||
|
|
||||||
sprintf (Query,"DELETE FROM crs_info_txt WHERE CrsCod=%ld",CrsCod);
|
sprintf (Query,"DELETE FROM crs_info_txt WHERE CrsCod=%ld",CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove info of a course");
|
DB_QueryDELETE (Query,"can not remove info of a course");
|
||||||
|
|
||||||
/***** Remove exam announcements in the course *****/
|
/***** Remove exam announcements in the course *****/
|
||||||
/* Mark all exam announcements in the course as deleted */
|
/* Mark all exam announcements in the course as deleted */
|
||||||
sprintf (Query,"UPDATE exam_announcements SET Status=%u"
|
sprintf (Query,"UPDATE exam_announcements SET Status=%u"
|
||||||
" WHERE CrsCod=%ld",
|
" WHERE CrsCod=%ld",
|
||||||
(unsigned) Exa_DELETED_EXAM_ANNOUNCEMENT,CrsCod);
|
(unsigned) Exa_DELETED_EXAM_ANNOUNCEMENT,CrsCod);
|
||||||
DB_QueryUPDATE (Query,"can not remove exam announcements of a course");
|
DB_QueryUPDATE (Query,"can not remove exam announcements of a course");
|
||||||
|
|
||||||
/***** Remove course cards of the course *****/
|
/***** Remove course cards of the course *****/
|
||||||
/* Remove content of course cards */
|
/* Remove content of course cards */
|
||||||
sprintf (Query,"DELETE FROM crs_records USING crs_record_fields,crs_records"
|
sprintf (Query,"DELETE FROM crs_records USING crs_record_fields,crs_records"
|
||||||
" WHERE crs_record_fields.CrsCod=%ld"
|
" WHERE crs_record_fields.CrsCod=%ld"
|
||||||
" AND crs_record_fields.FieldCod=crs_records.FieldCod",
|
" AND crs_record_fields.FieldCod=crs_records.FieldCod",
|
||||||
CrsCod);
|
CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove content of cards in a course");
|
DB_QueryDELETE (Query,"can not remove content of cards in a course");
|
||||||
|
|
||||||
/* Remove definition of fields in course cards */
|
/* Remove definition of fields in course cards */
|
||||||
sprintf (Query,"DELETE FROM crs_record_fields WHERE CrsCod=%ld",CrsCod);
|
sprintf (Query,"DELETE FROM crs_record_fields WHERE CrsCod=%ld",CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove fields of cards in a course");
|
DB_QueryDELETE (Query,"can not remove fields of cards in a course");
|
||||||
|
|
||||||
/***** Remove assignments of the course *****/
|
/***** Remove assignments of the course *****/
|
||||||
Asg_RemoveCrsAssignments (CrsCod);
|
Asg_RemoveCrsAssignments (CrsCod);
|
||||||
|
|
||||||
/***** Remove attendance events of the course *****/
|
/***** Remove attendance events of the course *****/
|
||||||
Att_RemoveCrsAttEvents (CrsCod);
|
Att_RemoveCrsAttEvents (CrsCod);
|
||||||
|
|
||||||
/***** Remove notices in the course *****/
|
/***** Remove notices in the course *****/
|
||||||
/* Copy all notices from the course to table of deleted notices */
|
/* Copy all notices from the course to table of deleted notices */
|
||||||
sprintf (Query,"INSERT INTO notices_deleted"
|
sprintf (Query,"INSERT INTO notices_deleted"
|
||||||
" (NotCod,CrsCod,UsrCod,CreatTime,Content,NumNotif)"
|
" (NotCod,CrsCod,UsrCod,CreatTime,Content,NumNotif)"
|
||||||
" SELECT NotCod,CrsCod,UsrCod,CreatTime,Content,NumNotif FROM notices"
|
" SELECT NotCod,CrsCod,UsrCod,CreatTime,Content,NumNotif FROM notices"
|
||||||
" WHERE CrsCod=%ld",
|
" WHERE CrsCod=%ld",
|
||||||
CrsCod);
|
CrsCod);
|
||||||
DB_QueryINSERT (Query,"can not remove notices in a course");
|
DB_QueryINSERT (Query,"can not remove notices in a course");
|
||||||
/* Remove all notices from the course */
|
/* Remove all notices from the course */
|
||||||
sprintf (Query,"DELETE FROM notices WHERE CrsCod=%ld",CrsCod);
|
sprintf (Query,"DELETE FROM notices WHERE CrsCod=%ld",CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove notices in a course");
|
DB_QueryDELETE (Query,"can not remove notices in a course");
|
||||||
|
|
||||||
/***** Remove all the threads and posts in forums of the course *****/
|
/***** Remove all the threads and posts in forums of the course *****/
|
||||||
For_RemoveForums (Sco_SCOPE_CRS,CrsCod);
|
For_RemoveForums (Sco_SCOPE_CRS,CrsCod);
|
||||||
|
|
||||||
/***** Remove surveys of the course *****/
|
/***** Remove surveys of the course *****/
|
||||||
Svy_RemoveSurveys (Sco_SCOPE_CRS,CrsCod);
|
Svy_RemoveSurveys (Sco_SCOPE_CRS,CrsCod);
|
||||||
|
|
||||||
/***** Remove all test exams made in the course *****/
|
/***** Remove all test exams made in the course *****/
|
||||||
Tst_RemoveCrsTestResults (CrsCod);
|
Tst_RemoveCrsTestResults (CrsCod);
|
||||||
|
|
||||||
/***** Remove all tests questions in the course *****/
|
/***** Remove all tests questions in the course *****/
|
||||||
Tst_RemoveCrsTests (CrsCod);
|
Tst_RemoveCrsTests (CrsCod);
|
||||||
|
|
||||||
/***** Remove groups in the course *****/
|
/***** Remove groups in the course *****/
|
||||||
/* Remove all the users in groups in the course */
|
/* Remove all the users in groups in the course */
|
||||||
sprintf (Query,"DELETE FROM crs_grp_usr"
|
sprintf (Query,"DELETE FROM crs_grp_usr"
|
||||||
" USING crs_grp_types,crs_grp,crs_grp_usr"
|
" USING crs_grp_types,crs_grp,crs_grp_usr"
|
||||||
" WHERE crs_grp_types.CrsCod=%ld"
|
" WHERE crs_grp_types.CrsCod=%ld"
|
||||||
" AND crs_grp_types.GrpTypCod=crs_grp.GrpTypCod"
|
" AND crs_grp_types.GrpTypCod=crs_grp.GrpTypCod"
|
||||||
" AND crs_grp.GrpCod=crs_grp_usr.GrpCod",
|
" AND crs_grp.GrpCod=crs_grp_usr.GrpCod",
|
||||||
CrsCod);
|
CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove users from groups of a course");
|
DB_QueryDELETE (Query,"can not remove users from groups of a course");
|
||||||
|
|
||||||
/* Remove all the groups in the course */
|
/* Remove all the groups in the course */
|
||||||
sprintf (Query,"DELETE FROM crs_grp"
|
sprintf (Query,"DELETE FROM crs_grp"
|
||||||
" USING crs_grp_types,crs_grp"
|
" USING crs_grp_types,crs_grp"
|
||||||
" WHERE crs_grp_types.CrsCod=%ld"
|
" WHERE crs_grp_types.CrsCod=%ld"
|
||||||
" AND crs_grp_types.GrpTypCod=crs_grp.GrpTypCod",
|
" AND crs_grp_types.GrpTypCod=crs_grp.GrpTypCod",
|
||||||
CrsCod);
|
CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove groups of a course");
|
DB_QueryDELETE (Query,"can not remove groups of a course");
|
||||||
|
|
||||||
/* Remove all the group types in the course */
|
/* Remove all the group types in the course */
|
||||||
sprintf (Query,"DELETE FROM crs_grp_types"
|
sprintf (Query,"DELETE FROM crs_grp_types"
|
||||||
" WHERE CrsCod=%ld",
|
" WHERE CrsCod=%ld",
|
||||||
CrsCod);
|
CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove types of group of a course");
|
DB_QueryDELETE (Query,"can not remove types of group of a course");
|
||||||
|
|
||||||
/***** Remove users' requests for inscription in the course *****/
|
/***** Remove users' requests for inscription in the course *****/
|
||||||
sprintf (Query,"DELETE FROM crs_usr_requests WHERE CrsCod=%ld",
|
sprintf (Query,"DELETE FROM crs_usr_requests WHERE CrsCod=%ld",
|
||||||
CrsCod);
|
CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove requests for inscription to a course");
|
DB_QueryDELETE (Query,"can not remove requests for inscription to a course");
|
||||||
|
|
||||||
/***** Remove possible users remaining in the course (teachers) *****/
|
/***** Remove possible users remaining in the course (teachers) *****/
|
||||||
sprintf (Query,"DELETE FROM crs_usr WHERE CrsCod=%ld",
|
sprintf (Query,"DELETE FROM crs_usr WHERE CrsCod=%ld",
|
||||||
CrsCod);
|
CrsCod);
|
||||||
DB_QueryDELETE (Query,"can not remove users from a course");
|
DB_QueryDELETE (Query,"can not remove users from a course");
|
||||||
|
|
||||||
/***** Remove information related to files in course *****/
|
/***** Remove information related to files in course *****/
|
||||||
Brw_RemoveCrsFilesFromDB (CrsCod);
|
Brw_RemoveCrsFilesFromDB (CrsCod);
|
||||||
|
|
||||||
/***** Remove directories of the course *****/
|
/***** Remove directories of the course *****/
|
||||||
sprintf (PathRelCrs,"%s/%s/%ld",
|
sprintf (PathRelCrs,"%s/%s/%ld",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,CrsCod);
|
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,CrsCod);
|
||||||
Fil_RemoveTree (PathRelCrs);
|
Fil_RemoveTree (PathRelCrs);
|
||||||
sprintf (PathRelCrs,"%s/%s/%ld",
|
sprintf (PathRelCrs,"%s/%s/%ld",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CRS,CrsCod);
|
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CRS,CrsCod);
|
||||||
Fil_RemoveTree (PathRelCrs);
|
Fil_RemoveTree (PathRelCrs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2295,7 +2301,7 @@ void Crs_ChangeInsCrsCod (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get course code */
|
/* Get course code */
|
||||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod ();
|
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod (1);
|
||||||
|
|
||||||
/* Get institutional code */
|
/* Get institutional code */
|
||||||
Par_GetParToText ("InsCrsCod",NewInstitutionalCrsCod,Crs_MAX_BYTES_INSTITUTIONAL_CRS_COD);
|
Par_GetParToText ("InsCrsCod",NewInstitutionalCrsCod,Crs_MAX_BYTES_INSTITUTIONAL_CRS_COD);
|
||||||
|
@ -2339,7 +2345,7 @@ void Crs_ChangeCrsDegInConfig (void)
|
||||||
struct Degree NewDeg;
|
struct Degree NewDeg;
|
||||||
|
|
||||||
/***** Get parameter with degree code *****/
|
/***** Get parameter with degree code *****/
|
||||||
NewDeg.DegCod = Deg_GetAndCheckParamOtherDegCod ();
|
NewDeg.DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||||
|
|
||||||
/***** Check if degree has changed *****/
|
/***** Check if degree has changed *****/
|
||||||
if (NewDeg.DegCod != Gbl.CurrentCrs.Crs.DegCod)
|
if (NewDeg.DegCod != Gbl.CurrentCrs.Crs.DegCod)
|
||||||
|
@ -2477,7 +2483,7 @@ void Crs_ChangeCrsYear (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get course code */
|
/* Get course code */
|
||||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod ();
|
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod (1);
|
||||||
|
|
||||||
/* Get parameter with year */
|
/* Get parameter with year */
|
||||||
Par_GetParToText ("OthCrsYear",YearStr,2);
|
Par_GetParToText ("OthCrsYear",YearStr,2);
|
||||||
|
@ -2572,7 +2578,7 @@ void Crs_UpdateInstitutionalCrsCod (struct Course *Crs,const char *NewInstitutio
|
||||||
|
|
||||||
void Crs_RenameCourseShort (void)
|
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);
|
Crs_RenameCourse (&Gbl.Degs.EditingCrs,Cns_SHRT_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2587,7 +2593,7 @@ void Crs_RenameCourseShortInConfig (void)
|
||||||
|
|
||||||
void Crs_RenameCourseFull (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);
|
Crs_RenameCourse (&Gbl.Degs.EditingCrs,Cns_FULL_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2732,7 +2738,7 @@ void Crs_ChangeCrsStatus (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get course code */
|
/* Get course code */
|
||||||
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod ();
|
Gbl.Degs.EditingCrs.CrsCod = Crs_GetAndCheckParamOtherCrsCod (1);
|
||||||
|
|
||||||
/* Get parameter with status */
|
/* Get parameter with status */
|
||||||
Status = (Crs_Status_t)
|
Status = (Crs_Status_t)
|
||||||
|
@ -2938,13 +2944,13 @@ static void Crs_PutParamOtherCrsCod (long CrsCod)
|
||||||
/********************* Get parameter with code of course *********************/
|
/********************* Get parameter with code of course *********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static long Crs_GetAndCheckParamOtherCrsCod (void)
|
static long Crs_GetAndCheckParamOtherCrsCod (long MinCodAllowed)
|
||||||
{
|
{
|
||||||
long CrsCod;
|
long CrsCod;
|
||||||
|
|
||||||
/***** Get and check parameter with code of course *****/
|
/***** Get and check parameter with code of course *****/
|
||||||
if ((CrsCod = Par_GetParToLong ("OthCrsCod")) <= 0)
|
if ((CrsCod = Par_GetParToLong ("OthCrsCod")) < MinCodAllowed)
|
||||||
Lay_ShowErrorAndExit ("Code of course is missing.");
|
Lay_ShowErrorAndExit ("Code of course is missing or invalid.");
|
||||||
|
|
||||||
return CrsCod;
|
return CrsCod;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1543,8 +1543,7 @@ static void Deg_RecFormRequestOrCreateDeg (unsigned Status)
|
||||||
Par_GetParToText ("FullName",Gbl.Degs.EditingDeg.FullName,Hie_MAX_BYTES_FULL_NAME);
|
Par_GetParToText ("FullName",Gbl.Degs.EditingDeg.FullName,Hie_MAX_BYTES_FULL_NAME);
|
||||||
|
|
||||||
/* Get degree type */
|
/* Get degree type */
|
||||||
if ((Gbl.Degs.EditingDeg.DegTypCod = DT_GetParamOtherDegTypCod ()) <= 0)
|
Gbl.Degs.EditingDeg.DegTypCod = DT_GetAndCheckParamOtherDegTypCod (1);
|
||||||
Ale_ShowAlert (Ale_ERROR,"Wrong type of degree.");
|
|
||||||
|
|
||||||
/* Get degree WWW */
|
/* Get degree WWW */
|
||||||
Par_GetParToText ("WWW",Gbl.Degs.EditingDeg.WWW,Cns_MAX_BYTES_WWW);
|
Par_GetParToText ("WWW",Gbl.Degs.EditingDeg.WWW,Cns_MAX_BYTES_WWW);
|
||||||
|
@ -1597,7 +1596,7 @@ void Deg_RemoveDegree (void)
|
||||||
struct Degree Deg;
|
struct Degree Deg;
|
||||||
|
|
||||||
/***** Get degree code *****/
|
/***** Get degree code *****/
|
||||||
Deg.DegCod = Deg_GetAndCheckParamOtherDegCod ();
|
Deg.DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||||
|
|
||||||
/***** Get data of degree *****/
|
/***** Get data of degree *****/
|
||||||
Deg_GetDataOfDegreeByCod (&Deg);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
@ -1642,13 +1641,13 @@ static void Deg_PutParamOtherDegCod (long DegCod)
|
||||||
/********************* Get parameter with code of degree *********************/
|
/********************* Get parameter with code of degree *********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
long Deg_GetAndCheckParamOtherDegCod (void)
|
long Deg_GetAndCheckParamOtherDegCod (long MinCodAllowed)
|
||||||
{
|
{
|
||||||
long DegCod;
|
long DegCod;
|
||||||
|
|
||||||
/***** Get and check parameter with code of degree *****/
|
/***** Get and check parameter with code of degree *****/
|
||||||
if ((DegCod = Par_GetParToLong ("OthDegCod")) <= 0)
|
if ((DegCod = Par_GetParToLong ("OthDegCod")) < MinCodAllowed)
|
||||||
Lay_ShowErrorAndExit ("Code of degree is missing.");
|
Lay_ShowErrorAndExit ("Code of degree is missing or invalid.");
|
||||||
|
|
||||||
return DegCod;
|
return DegCod;
|
||||||
}
|
}
|
||||||
|
@ -1902,7 +1901,7 @@ void Deg_RemoveDegreeCompletely (long DegCod)
|
||||||
|
|
||||||
void Deg_RenameDegreeShort (void)
|
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);
|
Deg_RenameDegree (&Gbl.Degs.EditingDeg,Cns_SHRT_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1917,7 +1916,7 @@ void Deg_RenameDegreeShortInConfig (void)
|
||||||
|
|
||||||
void Deg_RenameDegreeFull (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);
|
Deg_RenameDegree (&Gbl.Degs.EditingDeg,Cns_FULL_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2047,7 +2046,7 @@ void Deg_ChangeDegCtrInConfig (void)
|
||||||
struct Centre NewCtr;
|
struct Centre NewCtr;
|
||||||
|
|
||||||
/***** Get parameter with centre code *****/
|
/***** Get parameter with centre code *****/
|
||||||
NewCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
NewCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||||
|
|
||||||
/***** Check if centre has changed *****/
|
/***** Check if centre has changed *****/
|
||||||
if (NewCtr.CtrCod != Gbl.CurrentDeg.Deg.CtrCod)
|
if (NewCtr.CtrCod != Gbl.CurrentDeg.Deg.CtrCod)
|
||||||
|
@ -2126,7 +2125,7 @@ void Deg_ChangeDegWWW (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the degree */
|
/* 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 */
|
/* Get the new WWW for the degree */
|
||||||
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||||
|
@ -2211,7 +2210,7 @@ void Deg_ChangeDegStatus (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get degree code */
|
/* Get degree code */
|
||||||
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod ();
|
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||||
|
|
||||||
/* Get parameter with status */
|
/* Get parameter with status */
|
||||||
Status = (Deg_Status_t)
|
Status = (Deg_Status_t)
|
||||||
|
|
|
@ -112,7 +112,7 @@ void Deg_RecFormNewDeg (void);
|
||||||
void Deg_RemoveDegree (void);
|
void Deg_RemoveDegree (void);
|
||||||
|
|
||||||
void Deg_PutParamDegCod (long DegCod);
|
void Deg_PutParamDegCod (long DegCod);
|
||||||
long Deg_GetAndCheckParamOtherDegCod (void);
|
long Deg_GetAndCheckParamOtherDegCod (long MinCodAllowed);
|
||||||
|
|
||||||
bool Deg_GetDataOfDegreeByCod (struct Degree *Deg);
|
bool Deg_GetDataOfDegreeByCod (struct Degree *Deg);
|
||||||
void Deg_GetShortNameOfDegreeByCod (struct Degree *Deg);
|
void Deg_GetShortNameOfDegreeByCod (struct Degree *Deg);
|
||||||
|
|
|
@ -746,8 +746,7 @@ void DT_RemoveDegreeType (void)
|
||||||
struct DegreeType DegTyp;
|
struct DegreeType DegTyp;
|
||||||
|
|
||||||
/***** Get the code of the degree type *****/
|
/***** Get the code of the degree type *****/
|
||||||
if ((DegTyp.DegTypCod = DT_GetParamOtherDegTypCod ()) == -1L)
|
DegTyp.DegTypCod = DT_GetAndCheckParamOtherDegTypCod (1);
|
||||||
Lay_ShowErrorAndExit ("Code of type of degree is missing.");
|
|
||||||
|
|
||||||
/***** Get data of the degree type from database *****/
|
/***** Get data of the degree type from database *****/
|
||||||
if (!DT_GetDataOfDegreeTypeByCod (&DegTyp))
|
if (!DT_GetDataOfDegreeTypeByCod (&DegTyp))
|
||||||
|
@ -784,10 +783,15 @@ static void DT_PutParamOtherDegTypCod (long DegTypCod)
|
||||||
/******************* Get parameter with code of degree type ******************/
|
/******************* Get parameter with code of degree type ******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
long DT_GetParamOtherDegTypCod (void)
|
long DT_GetAndCheckParamOtherDegTypCod (long MinCodAllowed)
|
||||||
{
|
{
|
||||||
/***** Get code of degree type *****/
|
long DegTypCod;
|
||||||
return Par_GetParToLong ("OthDegTypCod");
|
|
||||||
|
/***** 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 parameters from form *****/
|
||||||
/* Get the code of the degree type */
|
/* Get the code of the degree type */
|
||||||
if ((DegTyp->DegTypCod = DT_GetParamOtherDegTypCod ()) == -1L)
|
DegTyp->DegTypCod = DT_GetAndCheckParamOtherDegTypCod (1);
|
||||||
Lay_ShowErrorAndExit ("Code of type of degree is missing.");
|
|
||||||
|
|
||||||
/* Get the new name for the degree type */
|
/* Get the new name for the degree type */
|
||||||
Par_GetParToText ("DegTypName",NewNameDegTyp,Deg_MAX_BYTES_DEGREE_TYPE_NAME);
|
Par_GetParToText ("DegTypName",NewNameDegTyp,Deg_MAX_BYTES_DEGREE_TYPE_NAME);
|
||||||
|
@ -1003,10 +1006,10 @@ void DT_ChangeDegreeType (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get degree code */
|
/* Get degree code */
|
||||||
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod ();
|
Gbl.Degs.EditingDeg.DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||||
|
|
||||||
/* Get the new degree type */
|
/* Get the new degree type */
|
||||||
NewDegTypCod = DT_GetParamOtherDegTypCod ();
|
NewDegTypCod = DT_GetAndCheckParamOtherDegTypCod (1);
|
||||||
|
|
||||||
/***** Get data of degree *****/
|
/***** Get data of degree *****/
|
||||||
Deg_GetDataOfDegreeByCod (&Gbl.Degs.EditingDeg);
|
Deg_GetDataOfDegreeByCod (&Gbl.Degs.EditingDeg);
|
||||||
|
|
|
@ -74,7 +74,7 @@ void DT_RecFormNewDegreeType (void);
|
||||||
|
|
||||||
void DT_RemoveDegreeType (void);
|
void DT_RemoveDegreeType (void);
|
||||||
|
|
||||||
long DT_GetParamOtherDegTypCod (void);
|
long DT_GetAndCheckParamOtherDegTypCod (long MinCodAllowed);
|
||||||
|
|
||||||
bool DT_GetDataOfDegreeTypeByCod (struct DegreeType *DegTyp);
|
bool DT_GetDataOfDegreeTypeByCod (struct DegreeType *DegTyp);
|
||||||
void DT_RenameDegreeType (void);
|
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 *****/
|
long DptCod;
|
||||||
return Par_GetParToLong ("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;
|
struct Department Dpt;
|
||||||
|
|
||||||
/***** Get department code *****/
|
/***** Get department code *****/
|
||||||
if ((Dpt.DptCod = Dpt_GetParamDptCod ()) == -1L)
|
Dpt.DptCod = Dpt_GetAndCheckParamDptCod (1);
|
||||||
Lay_ShowErrorAndExit ("Code of department is missing.");
|
|
||||||
|
|
||||||
/***** Get data of the department from database *****/
|
/***** Get data of the department from database *****/
|
||||||
Dpt_GetDataOfDepartmentByCod (&Dpt);
|
Dpt_GetDataOfDepartmentByCod (&Dpt);
|
||||||
|
@ -661,11 +665,10 @@ void Dpt_ChangeDepartIns (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the department */
|
/* Get the code of the department */
|
||||||
if ((Dpt->DptCod = Dpt_GetParamDptCod ()) == -1L)
|
Dpt->DptCod = Dpt_GetAndCheckParamDptCod (1);
|
||||||
Lay_ShowErrorAndExit ("Code of department is missing.");
|
|
||||||
|
|
||||||
/* Get parameter with institution code */
|
/* Get parameter with institution code */
|
||||||
Dpt->InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
Dpt->InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||||
|
|
||||||
/***** Update institution in table of departments *****/
|
/***** Update institution in table of departments *****/
|
||||||
sprintf (Query,"UPDATE departments SET InsCod=%ld WHERE DptCod=%ld",
|
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 parameters from form *****/
|
||||||
/* Get the code of the department */
|
/* Get the code of the department */
|
||||||
if ((Dpt->DptCod = Dpt_GetParamDptCod ()) == -1L)
|
Dpt->DptCod = Dpt_GetAndCheckParamDptCod (1);
|
||||||
Lay_ShowErrorAndExit ("Code of department is missing.");
|
|
||||||
|
|
||||||
/* Get the new name for the department */
|
/* Get the new name for the department */
|
||||||
Par_GetParToText (ParamName,NewDptName,MaxBytes);
|
Par_GetParToText (ParamName,NewDptName,MaxBytes);
|
||||||
|
@ -831,8 +833,7 @@ void Dpt_ChangeDptWWW (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the department */
|
/* Get the code of the department */
|
||||||
if ((Dpt->DptCod = Dpt_GetParamDptCod ()) == -1L)
|
Dpt->DptCod = Dpt_GetAndCheckParamDptCod (1);
|
||||||
Lay_ShowErrorAndExit ("Code of department is missing.");
|
|
||||||
|
|
||||||
/* Get the new WWW for the department */
|
/* Get the new WWW for the department */
|
||||||
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||||
|
@ -1020,7 +1021,7 @@ void Dpt_RecFormNewDpt (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get institution */
|
/* Get institution */
|
||||||
Dpt->InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
Dpt->InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||||
|
|
||||||
/* Get department short name */
|
/* Get department short name */
|
||||||
Par_GetParToText ("ShortName",Dpt->ShrtName,Hie_MAX_BYTES_SHRT_NAME);
|
Par_GetParToText ("ShortName",Dpt->ShrtName,Hie_MAX_BYTES_SHRT_NAME);
|
||||||
|
|
|
@ -61,7 +61,7 @@ void Dpt_GetListDepartments (long InsCod);
|
||||||
void Dpt_FreeListDepartments (void);
|
void Dpt_FreeListDepartments (void);
|
||||||
unsigned Dpt_GetNumDepartmentsInInstitution (long InsCod);
|
unsigned Dpt_GetNumDepartmentsInInstitution (long InsCod);
|
||||||
void Dpt_GetDataOfDepartmentByCod (struct Department *Dpt);
|
void Dpt_GetDataOfDepartmentByCod (struct Department *Dpt);
|
||||||
long Dpt_GetParamDptCod (void);
|
long Dpt_GetAndCheckParamDptCod (long MinCodAllowed);
|
||||||
void Dpt_RemoveDepartment (void);
|
void Dpt_RemoveDepartment (void);
|
||||||
void Dpt_ChangeDepartIns (void);
|
void Dpt_ChangeDepartIns (void);
|
||||||
void Dpt_RenameDepartShort (void);
|
void Dpt_RenameDepartShort (void);
|
||||||
|
|
|
@ -222,11 +222,12 @@ static void Ind_GetParamsIndicators (void)
|
||||||
Sco_GetScope ("ScopeInd");
|
Sco_GetScope ("ScopeInd");
|
||||||
|
|
||||||
/***** Get degree type code *****/
|
/***** Get degree type code *****/
|
||||||
Gbl.Stat.DegTypCod = (Gbl.Scope.Current == Sco_SCOPE_SYS) ? DT_GetParamOtherDegTypCod () :
|
Gbl.Stat.DegTypCod = (Gbl.Scope.Current == Sco_SCOPE_SYS) ?
|
||||||
-1L;
|
DT_GetAndCheckParamOtherDegTypCod (-1L) : // -1L (any degree type) is allowed here
|
||||||
|
-1L;
|
||||||
|
|
||||||
/***** Get department code *****/
|
/***** Get department code *****/
|
||||||
Gbl.Stat.DptCod = Dpt_GetParamDptCod ();
|
Gbl.Stat.DptCod = Dpt_GetAndCheckParamDptCod (-1L); // -1L (any department) is allowed here
|
||||||
|
|
||||||
/***** Get number of indicators *****/
|
/***** Get number of indicators *****/
|
||||||
Ind_GetParamNumIndicators ();
|
Ind_GetParamNumIndicators ();
|
||||||
|
|
|
@ -1641,13 +1641,13 @@ static void Ins_PutParamOtherInsCod (long InsCod)
|
||||||
/******************* Get parameter with code of institution ******************/
|
/******************* Get parameter with code of institution ******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
long Ins_GetAndCheckParamOtherInsCod (void)
|
long Ins_GetAndCheckParamOtherInsCod (long MinCodAllowed)
|
||||||
{
|
{
|
||||||
long InsCod;
|
long InsCod;
|
||||||
|
|
||||||
/***** Get and check parameter with code of institution *****/
|
/***** Get and check parameter with code of institution *****/
|
||||||
if ((InsCod = Ins_GetParamOtherInsCod ()) < 0)
|
if ((InsCod = Ins_GetParamOtherInsCod ()) < MinCodAllowed)
|
||||||
Lay_ShowErrorAndExit ("Code of institution is missing.");
|
Lay_ShowErrorAndExit ("Code of institution is missing or invalid.");
|
||||||
|
|
||||||
return InsCod;
|
return InsCod;
|
||||||
}
|
}
|
||||||
|
@ -1671,7 +1671,7 @@ void Ins_RemoveInstitution (void)
|
||||||
char PathIns[PATH_MAX + 1];
|
char PathIns[PATH_MAX + 1];
|
||||||
|
|
||||||
/***** Get institution code *****/
|
/***** Get institution code *****/
|
||||||
Ins.InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
Ins.InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||||
|
|
||||||
/***** Get data of the institution from database *****/
|
/***** Get data of the institution from database *****/
|
||||||
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_EXTRA_DATA);
|
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_EXTRA_DATA);
|
||||||
|
@ -1722,7 +1722,7 @@ void Ins_RemoveInstitution (void)
|
||||||
|
|
||||||
void Ins_RenameInsShort (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);
|
Ins_RenameInstitution (&Gbl.Inss.EditingIns,Cns_SHRT_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1737,7 +1737,7 @@ void Ins_RenameInsShortInConfig (void)
|
||||||
|
|
||||||
void Ins_RenameInsFull (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);
|
Ins_RenameInstitution (&Gbl.Inss.EditingIns,Cns_FULL_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1867,7 +1867,7 @@ void Ins_ChangeInsCtyInConfig (void)
|
||||||
struct Country NewCty;
|
struct Country NewCty;
|
||||||
|
|
||||||
/***** Get the new country code for the institution *****/
|
/***** Get the new country code for the institution *****/
|
||||||
NewCty.CtyCod = Cty_GetAndCheckParamOtherCtyCod ();
|
NewCty.CtyCod = Cty_GetAndCheckParamOtherCtyCod (0);
|
||||||
|
|
||||||
/***** Check if country has changed *****/
|
/***** Check if country has changed *****/
|
||||||
if (NewCty.CtyCod != Gbl.CurrentIns.Ins.CtyCod)
|
if (NewCty.CtyCod != Gbl.CurrentIns.Ins.CtyCod)
|
||||||
|
@ -1945,7 +1945,7 @@ void Ins_ChangeInsWWW (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the institution */
|
/* 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 */
|
/* Get the new WWW for the institution */
|
||||||
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||||
|
@ -2030,7 +2030,7 @@ void Ins_ChangeInsStatus (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get institution code */
|
/* Get institution code */
|
||||||
Gbl.Inss.EditingIns.InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
Gbl.Inss.EditingIns.InsCod = Ins_GetAndCheckParamOtherInsCod (1);
|
||||||
|
|
||||||
/* Get parameter with status */
|
/* Get parameter with status */
|
||||||
Status = (Ins_Status_t)
|
Status = (Ins_Status_t)
|
||||||
|
|
|
@ -111,7 +111,7 @@ void Ins_GetShortNameOfInstitutionByCod (struct Instit *Ins);
|
||||||
void Ins_FreeListInstitutions (void);
|
void Ins_FreeListInstitutions (void);
|
||||||
void Ins_WriteSelectorOfInstitution (void);
|
void Ins_WriteSelectorOfInstitution (void);
|
||||||
void Ins_PutParamInsCod (long InsCod);
|
void Ins_PutParamInsCod (long InsCod);
|
||||||
long Ins_GetAndCheckParamOtherInsCod (void);
|
long Ins_GetAndCheckParamOtherInsCod (long MinCodAllowed);
|
||||||
void Ins_RemoveInstitution (void);
|
void Ins_RemoveInstitution (void);
|
||||||
void Ins_RenameInsShort (void);
|
void Ins_RenameInsShort (void);
|
||||||
void Ins_RenameInsShortInConfig (void);
|
void Ins_RenameInsShortInConfig (void);
|
||||||
|
|
|
@ -1334,7 +1334,7 @@ void Pho_CalcPhotoDegree (void)
|
||||||
Fil_RemoveOldTmpFiles (PathPhotosTmpPriv,Cfg_TIME_TO_DELETE_PHOTOS_TMP_FILES,false);
|
Fil_RemoveOldTmpFiles (PathPhotosTmpPriv,Cfg_TIME_TO_DELETE_PHOTOS_TMP_FILES,false);
|
||||||
|
|
||||||
/***** Get the degree which photo will be computed *****/
|
/***** 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 *****/
|
/***** Prevent the computing of an average photo too recently updated *****/
|
||||||
if (Pho_GetTimeAvgPhotoWasComputed (DegCod) >=
|
if (Pho_GetTimeAvgPhotoWasComputed (DegCod) >=
|
||||||
|
|
|
@ -4249,7 +4249,7 @@ void Rec_ShowFormMyInsCtrDpt (void)
|
||||||
void Rec_ChgCountryOfMyInstitution (void)
|
void Rec_ChgCountryOfMyInstitution (void)
|
||||||
{
|
{
|
||||||
/***** Get country code of my institution *****/
|
/***** 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 *****/
|
/***** Update institution, centre and department *****/
|
||||||
// When country changes, the institution, centre and department must be reset
|
// When country changes, the institution, centre and department must be reset
|
||||||
|
@ -4272,7 +4272,7 @@ void Rec_UpdateMyInstitution (void)
|
||||||
|
|
||||||
/***** Get my institution *****/
|
/***** Get my institution *****/
|
||||||
/* Get institution code */
|
/* Get institution code */
|
||||||
Ins.InsCod = Ins_GetAndCheckParamOtherInsCod ();
|
Ins.InsCod = Ins_GetAndCheckParamOtherInsCod (0); // 0 (another institution) is allowed here
|
||||||
|
|
||||||
/* Get country of institution */
|
/* Get country of institution */
|
||||||
if (Ins.InsCod > 0)
|
if (Ins.InsCod > 0)
|
||||||
|
@ -4302,7 +4302,7 @@ void Rec_UpdateMyCentre (void)
|
||||||
|
|
||||||
/***** Get my centre *****/
|
/***** Get my centre *****/
|
||||||
/* Get centre code */
|
/* Get centre code */
|
||||||
Ctr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
|
Ctr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (0); // 0 (another centre) is allowed here
|
||||||
|
|
||||||
/* Get institution of centre */
|
/* Get institution of centre */
|
||||||
if (Ctr.CtrCod > 0)
|
if (Ctr.CtrCod > 0)
|
||||||
|
@ -4333,8 +4333,7 @@ void Rec_UpdateMyDepartment (void)
|
||||||
|
|
||||||
/***** Get my department *****/
|
/***** Get my department *****/
|
||||||
/* Get department code */
|
/* Get department code */
|
||||||
if ((Dpt.DptCod = Dpt_GetParamDptCod ()) < 0)
|
Dpt.DptCod = Dpt_GetAndCheckParamDptCod (0); // 0 (another department) is allowed here
|
||||||
Lay_ShowErrorAndExit ("Code of department is missing.");
|
|
||||||
|
|
||||||
/* Get institution of department */
|
/* Get institution of department */
|
||||||
if (Dpt.DptCod > 0)
|
if (Dpt.DptCod > 0)
|
||||||
|
|
Loading…
Reference in New Issue