Version 16.213

This commit is contained in:
Antonio Cañas Vargas 2017-05-11 20:55:04 +02:00
parent a8f24fc3c2
commit 2e2af1057a
4 changed files with 112 additions and 111 deletions

View File

@ -107,13 +107,14 @@ static void Ctr_UpdateInsNameDB (long CtrCod,const char *FieldName,const char *N
static void Ctr_UpdateCtrWWWDB (long CtrCod, static void Ctr_UpdateCtrWWWDB (long CtrCod,
const char NewWWW[Cns_MAX_BYTES_WWW + 1]); const char NewWWW[Cns_MAX_BYTES_WWW + 1]);
static void Ctr_PutButtonToGoToCtr (struct Centre *Ctr); static void Ctr_ShowAlertAndButtonToGoToCtr (void);
static void Ctr_PutParamGoToCtr (void);
static void Ctr_PutFormToCreateCentre (void); static void Ctr_PutFormToCreateCentre (void);
static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable); static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable);
static void Ctr_PutHeadCentresForEdition (void); static void Ctr_PutHeadCentresForEdition (void);
static void Ctr_RecFormRequestOrCreateCtr (unsigned Status); static void Ctr_RecFormRequestOrCreateCtr (unsigned Status);
static void Ctr_CreateCentre (struct Centre *Ctr,unsigned Status); static void Ctr_CreateCentre (unsigned Status);
/*****************************************************************************/ /*****************************************************************************/
/******************* List centres with pending degrees ***********************/ /******************* List centres with pending degrees ***********************/
@ -1840,33 +1841,30 @@ static void Ctr_UpdateCtrInsDB (long CtrCod,long InsCod)
void Ctr_ChangeCentrePlace (void) void Ctr_ChangeCentrePlace (void)
{ {
extern const char *Txt_The_place_of_the_centre_has_changed; extern const char *Txt_The_place_of_the_centre_has_changed;
struct Centre *Ctr;
long NewPlcCod; long NewPlcCod;
char Query[512]; char Query[512];
Ctr = &Gbl.Ctrs.EditingCtr;
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get centre code */ /* Get centre code */
Ctr->CtrCod = Ctr_GetAndCheckParamOtherCtrCod (); Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
/* Get parameter with centre code */ /* Get parameter with centre code */
NewPlcCod = Plc_GetParamPlcCod (); NewPlcCod = Plc_GetParamPlcCod ();
/***** Get data of centre from database *****/ /***** Get data of centre from database *****/
Ctr_GetDataOfCentreByCod (Ctr); Ctr_GetDataOfCentreByCod (&Gbl.Ctrs.EditingCtr);
/***** 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,Ctr->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");
Ctr->PlcCod = NewPlcCod; Gbl.Ctrs.EditingCtr.PlcCod = NewPlcCod;
/***** Write message to show the change made *****/ /***** Write message to show the change made
Lay_ShowAlert (Lay_SUCCESS,Txt_The_place_of_the_centre_has_changed); and put button to go to centre changed *****/
Gbl.Alert.Type = Lay_SUCCESS;
/***** Put button to go to centre changed *****/ sprintf (Gbl.Alert.Txt,"%s",Txt_The_place_of_the_centre_has_changed);
Ctr_PutButtonToGoToCtr (Ctr); Ctr_ShowAlertAndButtonToGoToCtr ();
/***** Show the form again *****/ /***** Show the form again *****/
Ctr_EditCentres (); Ctr_EditCentres ();
@ -2020,36 +2018,31 @@ void Ctr_ChangeCtrWWW (void)
{ {
extern const char *Txt_The_new_web_address_is_X; extern const char *Txt_The_new_web_address_is_X;
extern const char *Txt_You_can_not_leave_the_web_address_empty; extern const char *Txt_You_can_not_leave_the_web_address_empty;
struct Centre *Ctr;
char NewWWW[Cns_MAX_BYTES_WWW + 1]; char NewWWW[Cns_MAX_BYTES_WWW + 1];
Ctr = &Gbl.Ctrs.EditingCtr;
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get the code of the centre */ /* Get the code of the centre */
Ctr->CtrCod = Ctr_GetAndCheckParamOtherCtrCod (); 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 *****/
Ctr_GetDataOfCentreByCod (Ctr); Ctr_GetDataOfCentreByCod (&Gbl.Ctrs.EditingCtr);
/***** Check if new WWW is empty *****/ /***** Check if new WWW is empty *****/
if (NewWWW[0]) if (NewWWW[0])
{ {
/***** Update database changing old WWW by new WWW *****/ /***** Update database changing old WWW by new WWW *****/
Ctr_UpdateCtrWWWDB (Ctr->CtrCod,NewWWW); Ctr_UpdateCtrWWWDB (Gbl.Ctrs.EditingCtr.CtrCod,NewWWW);
Str_Copy (Gbl.Ctrs.EditingCtr.WWW,NewWWW,
Str_Copy (Ctr->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 *****/
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW); sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); Ctr_ShowAlertAndButtonToGoToCtr ();
/***** Put button to go to centre changed *****/
Ctr_PutButtonToGoToCtr (Ctr);
} }
else else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_web_address_empty); Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_web_address_empty);
@ -2109,16 +2102,13 @@ static void Ctr_UpdateCtrWWWDB (long CtrCod,
void Ctr_ChangeCtrStatus (void) void Ctr_ChangeCtrStatus (void)
{ {
extern const char *Txt_The_status_of_the_centre_X_has_changed; extern const char *Txt_The_status_of_the_centre_X_has_changed;
struct Centre *Ctr;
char Query[256]; char Query[256];
Ctr_Status_t Status; Ctr_Status_t Status;
Ctr_StatusTxt_t StatusTxt; Ctr_StatusTxt_t StatusTxt;
Ctr = &Gbl.Ctrs.EditingCtr;
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get centre code */ /* Get centre code */
Ctr->CtrCod = Ctr_GetAndCheckParamOtherCtrCod (); Gbl.Ctrs.EditingCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod ();
/* Get parameter with status */ /* Get parameter with status */
Status = (Ctr_Status_t) Status = (Ctr_Status_t)
@ -2132,22 +2122,20 @@ void Ctr_ChangeCtrStatus (void)
Status = Ctr_GetStatusBitsFromStatusTxt (StatusTxt); // New status Status = Ctr_GetStatusBitsFromStatusTxt (StatusTxt); // New status
/***** Get data of centre *****/ /***** Get data of centre *****/
Ctr_GetDataOfCentreByCod (Ctr); Ctr_GetDataOfCentreByCod (&Gbl.Ctrs.EditingCtr);
/***** 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,Ctr->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;
Ctr->Status = Status; /***** Write message to show the change made
and put button to go to centre changed *****/
/***** Write message to show the change made *****/ Gbl.Alert.Type = Lay_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,
Ctr->ShrtName); Gbl.Ctrs.EditingCtr.ShrtName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); Ctr_ShowAlertAndButtonToGoToCtr ();
/***** Put button to go to centre changed *****/
Ctr_PutButtonToGoToCtr (Ctr);
/***** Show the form again *****/ /***** Show the form again *****/
Ctr_EditCentres (); Ctr_EditCentres ();
@ -2159,36 +2147,44 @@ void Ctr_ChangeCtrStatus (void)
void Ctr_ContEditAfterChgCtr (void) void Ctr_ContEditAfterChgCtr (void)
{ {
/***** Write success / warning message *****/ /***** Write message to show the change made
Lay_ShowPendingAlert (); and put button to go to centre changed *****/
Ctr_ShowAlertAndButtonToGoToCtr ();
if (Gbl.Alert.Type == Lay_SUCCESS)
/***** Put button to go to centre changed *****/
Ctr_PutButtonToGoToCtr (&Gbl.Ctrs.EditingCtr);
/***** Show the form again *****/ /***** Show the form again *****/
Ctr_EditCentres (); Ctr_EditCentres ();
} }
/*****************************************************************************/ /*****************************************************************************/
/************************ Put button to go to centre *************************/ /***************** Write message to show the change made ********************/
/***************** and put button to go to centre changed ********************/
/*****************************************************************************/ /*****************************************************************************/
// Gbl.Ctrs.EditingCtr is the centre that is beeing edited
// Gbl.CurrentCtr.Ctr is the current centre
static void Ctr_PutButtonToGoToCtr (struct Centre *Ctr) static void Ctr_ShowAlertAndButtonToGoToCtr (void)
{ {
extern const char *Txt_Go_to_X; extern const char *Txt_Go_to_X;
// If the centre is different to the current one... /***** Start alert *****/
if (Ctr->CtrCod != Gbl.CurrentCtr.Ctr.CtrCod) Lay_ShowAlertAndButton1 (Gbl.Alert.Type,Gbl.Alert.Txt);
// If the centre being edited is different to the current one...
if (Gbl.Ctrs.EditingCtr.CtrCod != Gbl.CurrentCtr.Ctr.CtrCod)
{ {
fprintf (Gbl.F.Out,"<div class=\"BUTTONS_AFTER_ALERT\">"); /***** Put button to go to centre and end alert *****/
Act_FormStart (ActSeeDeg); sprintf (Gbl.Title,Txt_Go_to_X,Gbl.Ctrs.EditingCtr.ShrtName);
Ctr_PutParamCtrCod (Ctr->CtrCod); Lay_ShowAlertAndButton2 (ActSeeDeg,NULL,Ctr_PutParamGoToCtr,
sprintf (Gbl.Title,Txt_Go_to_X,Ctr->ShrtName); Lay_CONFIRM_BUTTON,Gbl.Title);
Lay_PutConfirmButtonInline (Gbl.Title);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</div>");
} }
else
/***** End alert *****/
Lay_ShowAlertAndButton2 (ActUnk,NULL,NULL,Lay_NO_BUTTON,NULL);
}
static void Ctr_PutParamGoToCtr (void)
{
Ctr_PutParamCtrCod (Gbl.Ctrs.EditingCtr.CtrCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -2418,12 +2414,8 @@ static void Ctr_PutFormToCreateCentre (void)
extern const char *Txt_New_centre; extern const char *Txt_New_centre;
extern const char *Txt_Another_place; extern const char *Txt_Another_place;
extern const char *Txt_Create_centre; extern const char *Txt_Create_centre;
struct Centre *Ctr;
unsigned NumPlc; unsigned NumPlc;
/***** Centre data *****/
Ctr = &Gbl.Ctrs.EditingCtr;
/***** Start form *****/ /***** Start form *****/
if (Gbl.Usrs.Me.LoggedRole >= Rol_INS_ADM) if (Gbl.Usrs.Me.LoggedRole >= Rol_INS_ADM)
Act_FormStart (ActNewCtr); Act_FormStart (ActNewCtr);
@ -2454,7 +2446,7 @@ static void Ctr_PutFormToCreateCentre (void)
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">" fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
"<select name=\"PlcCod\" style=\"width:62px;\">" "<select name=\"PlcCod\" style=\"width:62px;\">"
"<option value=\"0\""); "<option value=\"0\"");
if (Ctr->PlcCod == 0) if (Gbl.Ctrs.EditingCtr.PlcCod == 0)
fprintf (Gbl.F.Out," selected=\"selected\""); fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s</option>",Txt_Another_place); fprintf (Gbl.F.Out,">%s</option>",Txt_Another_place);
for (NumPlc = 0; for (NumPlc = 0;
@ -2462,8 +2454,8 @@ static void Ctr_PutFormToCreateCentre (void)
NumPlc++) NumPlc++)
fprintf (Gbl.F.Out,"<option value=\"%ld\"%s>%s</option>", fprintf (Gbl.F.Out,"<option value=\"%ld\"%s>%s</option>",
Gbl.Plcs.Lst[NumPlc].PlcCod, Gbl.Plcs.Lst[NumPlc].PlcCod,
(Gbl.Plcs.Lst[NumPlc].PlcCod == Ctr->PlcCod) ? " selected=\"selected\"" : (Gbl.Plcs.Lst[NumPlc].PlcCod == Gbl.Ctrs.EditingCtr.PlcCod) ? " selected=\"selected\"" :
"", "",
Gbl.Plcs.Lst[NumPlc].ShrtName); Gbl.Plcs.Lst[NumPlc].ShrtName);
fprintf (Gbl.F.Out,"</select>" fprintf (Gbl.F.Out,"</select>"
"</td>"); "</td>");
@ -2475,7 +2467,7 @@ static void Ctr_PutFormToCreateCentre (void)
" class=\"INPUT_SHORT_NAME\"" " class=\"INPUT_SHORT_NAME\""
" required=\"required\" />" " required=\"required\" />"
"</td>", "</td>",
Hie_MAX_CHARS_SHRT_NAME,Ctr->ShrtName); Hie_MAX_CHARS_SHRT_NAME,Gbl.Ctrs.EditingCtr.ShrtName);
/***** Centre full name *****/ /***** Centre full name *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">" fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
@ -2484,7 +2476,7 @@ static void Ctr_PutFormToCreateCentre (void)
" class=\"INPUT_FULL_NAME\"" " class=\"INPUT_FULL_NAME\""
" required=\"required\" />" " required=\"required\" />"
"</td>", "</td>",
Hie_MAX_CHARS_FULL_NAME,Ctr->FullName); Hie_MAX_CHARS_FULL_NAME,Gbl.Ctrs.EditingCtr.FullName);
/***** Centre WWW *****/ /***** Centre WWW *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">" fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
@ -2493,7 +2485,7 @@ static void Ctr_PutFormToCreateCentre (void)
" class=\"INPUT_WWW\"" " class=\"INPUT_WWW\""
" required=\"required\" />" " required=\"required\" />"
"</td>", "</td>",
Cns_MAX_CHARS_WWW,Ctr->WWW); Cns_MAX_CHARS_WWW,Gbl.Ctrs.EditingCtr.WWW);
/***** Number of users who claim to belong to this centre *****/ /***** Number of users who claim to belong to this centre *****/
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">" fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
@ -2678,46 +2670,44 @@ static void Ctr_RecFormRequestOrCreateCtr (unsigned Status)
extern const char *Txt_The_centre_X_already_exists; extern const char *Txt_The_centre_X_already_exists;
extern const char *Txt_You_must_specify_the_web_address_of_the_new_centre; extern const char *Txt_You_must_specify_the_web_address_of_the_new_centre;
extern const char *Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_centre; extern const char *Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_centre;
struct Centre *Ctr;
Ctr = &Gbl.Ctrs.EditingCtr;
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Set centre institution */ /* Set centre institution */
Ctr->InsCod = Gbl.CurrentIns.Ins.InsCod; Gbl.Ctrs.EditingCtr.InsCod = Gbl.CurrentIns.Ins.InsCod;
/* Get place */ /* Get place */
if ((Ctr->PlcCod = Plc_GetParamPlcCod ()) < 0) // 0 is reserved for "other place" if ((Gbl.Ctrs.EditingCtr.PlcCod = Plc_GetParamPlcCod ()) < 0) // 0 is reserved for "other place"
Lay_ShowAlert (Lay_ERROR,"Wrong place."); Lay_ShowAlert (Lay_ERROR,"Wrong place.");
/* Get centre short name */ /* Get centre short name */
Par_GetParToText ("ShortName",Ctr->ShrtName,Hie_MAX_BYTES_SHRT_NAME); Par_GetParToText ("ShortName",Gbl.Ctrs.EditingCtr.ShrtName,Hie_MAX_BYTES_SHRT_NAME);
/* Get centre full name */ /* Get centre full name */
Par_GetParToText ("FullName",Ctr->FullName,Hie_MAX_BYTES_FULL_NAME); Par_GetParToText ("FullName",Gbl.Ctrs.EditingCtr.FullName,Hie_MAX_BYTES_FULL_NAME);
/* Get centre WWW */ /* Get centre WWW */
Par_GetParToText ("WWW",Ctr->WWW,Cns_MAX_BYTES_WWW); Par_GetParToText ("WWW",Gbl.Ctrs.EditingCtr.WWW,Cns_MAX_BYTES_WWW);
if (Ctr->ShrtName[0] && Ctr->FullName[0]) // If there's a centre name if (Gbl.Ctrs.EditingCtr.ShrtName[0] &&
Gbl.Ctrs.EditingCtr.FullName[0]) // If there's a centre name
{ {
if (Ctr->WWW[0]) if (Gbl.Ctrs.EditingCtr.WWW[0])
{ {
/***** If name of centre was in database... *****/ /***** If name of centre was in database... *****/
if (Ctr_CheckIfCtrNameExistsInIns ("ShortName",Ctr->ShrtName,-1L,Gbl.CurrentIns.Ins.InsCod)) if (Ctr_CheckIfCtrNameExistsInIns ("ShortName",Gbl.Ctrs.EditingCtr.ShrtName,-1L,Gbl.CurrentIns.Ins.InsCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists, sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,
Ctr->ShrtName); Gbl.Ctrs.EditingCtr.ShrtName);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
} }
else if (Ctr_CheckIfCtrNameExistsInIns ("FullName",Ctr->FullName,-1L,Gbl.CurrentIns.Ins.InsCod)) else if (Ctr_CheckIfCtrNameExistsInIns ("FullName",Gbl.Ctrs.EditingCtr.FullName,-1L,Gbl.CurrentIns.Ins.InsCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists, sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,
Ctr->FullName); Gbl.Ctrs.EditingCtr.FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
} }
else // Add new centre to database else // Add new centre to database
Ctr_CreateCentre (Ctr,Status); Ctr_CreateCentre (Status);
} }
else // If there is not a web else // If there is not a web
{ {
@ -2738,8 +2728,9 @@ static void Ctr_RecFormRequestOrCreateCtr (unsigned Status)
/*****************************************************************************/ /*****************************************************************************/
/***************************** Create a new centre ***************************/ /***************************** Create a new centre ***************************/
/*****************************************************************************/ /*****************************************************************************/
// Gbl.Ctrs.EditingCtr must hold the centre beeing edited
static void Ctr_CreateCentre (struct Centre *Ctr,unsigned Status) static void Ctr_CreateCentre (unsigned Status)
{ {
extern const char *Txt_Created_new_centre_X; extern const char *Txt_Created_new_centre_X;
char Query[512 + char Query[512 +
@ -2754,19 +2745,21 @@ static void Ctr_CreateCentre (struct Centre *Ctr,unsigned Status)
" VALUES" " VALUES"
" (%ld,%ld,%u,%ld," " (%ld,%ld,%u,%ld,"
"'%s','%s','%s','')", "'%s','%s','%s','')",
Ctr->InsCod,Ctr->PlcCod, Gbl.Ctrs.EditingCtr.InsCod,
Gbl.Ctrs.EditingCtr.PlcCod,
Status, Status,
Gbl.Usrs.Me.UsrDat.UsrCod, Gbl.Usrs.Me.UsrDat.UsrCod,
Ctr->ShrtName,Ctr->FullName,Ctr->WWW); Gbl.Ctrs.EditingCtr.ShrtName,
Ctr->CtrCod = DB_QueryINSERTandReturnCode (Query,"can not create a new centre"); Gbl.Ctrs.EditingCtr.FullName,
Gbl.Ctrs.EditingCtr.WWW);
Gbl.Ctrs.EditingCtr.CtrCod = DB_QueryINSERTandReturnCode (Query,"can not create a new centre");
/***** Write success message *****/ /***** Write message to show the change made
and put button to go to centre created *****/
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_centre_X, sprintf (Gbl.Alert.Txt,Txt_Created_new_centre_X,
Ctr->FullName); Gbl.Ctrs.EditingCtr.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); Ctr_ShowAlertAndButtonToGoToCtr ();
/***** Put button to go to centre created *****/
Ctr_PutButtonToGoToCtr (Ctr);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -235,13 +235,14 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.212 (2017-05-10)" #define Log_PLATFORM_VERSION "SWAD 16.213 (2017-05-10)"
#define CSS_FILE "swad16.209.3.css" #define CSS_FILE "swad16.209.3.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.213: May 11, 2017 Changes in edition of centres. (218881 lines)
Version 16.212: May 11, 2017 Changes in edition of courses and degrees. (218870 lines) Version 16.212: May 11, 2017 Changes in edition of courses and degrees. (218870 lines)
Version 16.211.2: May 11, 2017 Fixed bug in alerts. (218879 lines) Version 16.211.2: May 11, 2017 Fixed bug in alerts. (218879 lines)
Version 16.211.1: May 11, 2017 Change in layout of forms to edit groups. (218882 lines) Version 16.211.1: May 11, 2017 Change in layout of forms to edit groups. (218882 lines)

View File

@ -113,8 +113,8 @@ static bool Crs_CheckIfCrsNameExistsInYearOfDeg (const char *FieldName,const cha
long DegCod,unsigned Year); long DegCod,unsigned Year);
static void Crs_UpdateCrsNameDB (long CrsCod,const char *FieldName,const char *NewCrsName); static void Crs_UpdateCrsNameDB (long CrsCod,const char *FieldName,const char *NewCrsName);
static void Crs_PutButtonToGoToCrs (struct Course *Crs); static void Crs_PutButtonToGoToCrs (void);
static void Crs_PutButtonToRegisterInCrs (struct Course *Crs); static void Crs_PutButtonToRegisterInCrs (void);
static void Crs_PutLinkToSearchCourses (void); static void Crs_PutLinkToSearchCourses (void);
static void Sch_PutLinkToSearchCoursesParams (void); static void Sch_PutLinkToSearchCoursesParams (void);
@ -2763,7 +2763,7 @@ void Crs_ContEditAfterChgCrs (void)
if (Gbl.Alert.Type == Lay_SUCCESS) if (Gbl.Alert.Type == Lay_SUCCESS)
{ {
/***** Put button to go to course changed *****/ /***** Put button to go to course changed *****/
Crs_PutButtonToGoToCrs (&Gbl.Degs.EditingCrs); Crs_PutButtonToGoToCrs ();
/***** Put button to request my registration in course *****/ /***** Put button to request my registration in course *****/
PutButtonToRequestRegistration = false; PutButtonToRequestRegistration = false;
@ -2789,7 +2789,7 @@ void Crs_ContEditAfterChgCrs (void)
} }
if (PutButtonToRequestRegistration) if (PutButtonToRequestRegistration)
Crs_PutButtonToRegisterInCrs (&Gbl.Degs.EditingCrs); Crs_PutButtonToRegisterInCrs ();
} }
/***** End alert *****/ /***** End alert *****/
@ -2802,17 +2802,19 @@ void Crs_ContEditAfterChgCrs (void)
/*****************************************************************************/ /*****************************************************************************/
/************************ Put button to go to course *************************/ /************************ Put button to go to course *************************/
/*****************************************************************************/ /*****************************************************************************/
// Gbl.Degs.EditingCrs is the course that is beeing edited
// Gbl.CurrentCrs.Crs is the current course
static void Crs_PutButtonToGoToCrs (struct Course *Crs) static void Crs_PutButtonToGoToCrs (void)
{ {
extern const char *Txt_Go_to_X; extern const char *Txt_Go_to_X;
// If the course is different to the current one... // If the course being edited is different to the current one...
if (Crs->CrsCod != Gbl.CurrentCrs.Crs.CrsCod) if (Gbl.Degs.EditingCrs.CrsCod != Gbl.CurrentCrs.Crs.CrsCod)
{ {
Act_FormStart (ActSeeCrsInf); Act_FormStart (ActSeeCrsInf);
Crs_PutParamCrsCod (Crs->CrsCod); Crs_PutParamCrsCod (Gbl.Degs.EditingCrs.CrsCod);
sprintf (Gbl.Title,Txt_Go_to_X,Crs->ShrtName); sprintf (Gbl.Title,Txt_Go_to_X,Gbl.Degs.EditingCrs.ShrtName);
Lay_PutConfirmButton (Gbl.Title); Lay_PutConfirmButton (Gbl.Title);
Act_FormEnd (); Act_FormEnd ();
} }
@ -2821,15 +2823,18 @@ static void Crs_PutButtonToGoToCrs (struct Course *Crs)
/*****************************************************************************/ /*****************************************************************************/
/************************ Put button to go to course *************************/ /************************ Put button to go to course *************************/
/*****************************************************************************/ /*****************************************************************************/
// Gbl.Degs.EditingCrs is the course that is beeing edited
// Gbl.CurrentCrs.Crs is the current course
static void Crs_PutButtonToRegisterInCrs (struct Course *Crs) static void Crs_PutButtonToRegisterInCrs (void)
{ {
extern const char *Txt_Register_me_in_X; extern const char *Txt_Register_me_in_X;
Act_FormStart (ActReqSignUp); Act_FormStart (ActReqSignUp);
if (Crs->CrsCod != Gbl.CurrentCrs.Crs.CrsCod) // If the course is different to the current one... // If the course beeing edited is different to the current one...
Crs_PutParamCrsCod (Crs->CrsCod); if (Gbl.Degs.EditingCrs.CrsCod != Gbl.CurrentCrs.Crs.CrsCod)
sprintf (Gbl.Title,Txt_Register_me_in_X,Crs->ShrtName); Crs_PutParamCrsCod (Gbl.Degs.EditingCrs.CrsCod);
sprintf (Gbl.Title,Txt_Register_me_in_X,Gbl.Degs.EditingCrs.ShrtName);
Lay_PutCreateButton (Gbl.Title); Lay_PutCreateButton (Gbl.Title);
Act_FormEnd (); Act_FormEnd ();
} }

View File

@ -1119,7 +1119,7 @@ unsigned Deg_ConvStrToYear (const char *StrYear)
/*****************************************************************************/ /*****************************************************************************/
/***************************** Create a new degree ***************************/ /***************************** Create a new degree ***************************/
/*****************************************************************************/ /*****************************************************************************/
// Gbl.Degs.EditingDeg must hold the degree // Gbl.Degs.EditingDeg must hold the degree beeing edited
static void Deg_CreateDegree (unsigned Status) static void Deg_CreateDegree (unsigned Status)
{ {
@ -2247,7 +2247,8 @@ void Deg_ChangeDegStatus (void)
void Deg_ContEditAfterChgDeg (void) void Deg_ContEditAfterChgDeg (void)
{ {
/***** Put button to go to degree changed *****/ /***** Write message to show the change made
and put button to go to degree changed *****/
Deg_ShowAlertAndButtonToGoToDeg (); Deg_ShowAlertAndButtonToGoToDeg ();
/***** Show the form again *****/ /***** Show the form again *****/
@ -2255,10 +2256,11 @@ void Deg_ContEditAfterChgDeg (void)
} }
/*****************************************************************************/ /*****************************************************************************/
/************************ Put button to go to degree *************************/ /***************** Write message to show the change made ********************/
/***************** and put button to go to degree changed ********************/
/*****************************************************************************/ /*****************************************************************************/
// Gbl.Degs.EditingDeg is the degree that is beeing edited // Gbl.Degs.EditingDeg is the degree that is beeing edited
// Gbl.CurrentDeg.Deg.DegCod is the current degree // Gbl.CurrentDeg.Deg is the current degree
void Deg_ShowAlertAndButtonToGoToDeg (void) void Deg_ShowAlertAndButtonToGoToDeg (void)
{ {