diff --git a/swad_action.c b/swad_action.c index 9dc45ffc..fcf8563a 100644 --- a/swad_action.c +++ b/swad_action.c @@ -245,6 +245,7 @@ Centre: 128. ActChgCtrInsCfg Request change of the institution of a centre in centre configuration 129. ActRenCtrShoCfg Change short name centre in centre configuration 130. ActRenCtrFulCfg Change full name centre in centre configuration + NEW. ActChgCtrPlcCfg Change place of centre in centre configuration 131. ActChgCtrWWWCfg Change web of centre in centre configuration 132. ActReqCtrLog Show form to send the logo of the current centre 133. ActRecCtrLog Receive and store the logo of the current centre @@ -1627,7 +1628,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActReqCtr */{1208,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ctr_RecFormReqCtr ,NULL}, /* ActNewCtr */{ 685,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ctr_RecFormNewCtr ,NULL}, /* ActRemCtr */{ 686,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ctr_RemoveCentre ,NULL}, - /* ActChgDegPlc */{ 706,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ctr_ChangeCentrePlace ,NULL}, + /* ActChgDegPlc */{ 706,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ctr_ChangeCtrPlc ,NULL}, /* ActRenCtrSho */{ 682,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,Ctr_RenameCentreShort ,Ctr_ContEditAfterChgCtr ,NULL}, /* ActRenCtrFul */{ 684,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,Ctr_RenameCentreFull ,Ctr_ContEditAfterChgCtr ,NULL}, /* ActChgCtrWWW */{ 683,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ctr_ChangeCtrWWW ,NULL}, @@ -1675,6 +1676,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActChgCtrInsCfg */{1589,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x200, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,Ctr_ChangeCtrInsInConfig ,Ctr_ContEditAfterChgCtrInConfig,NULL}, /* ActRenCtrShoCfg */{1595,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x300, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,Ctr_RenameCentreShortInConfig ,Ctr_ContEditAfterChgCtrInConfig,NULL}, /* ActRenCtrFulCfg */{1594,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x300, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,Ctr_RenameCentreFullInConfig ,Ctr_ContEditAfterChgCtrInConfig,NULL}, + /* ActChgCtrPlcCfg */{1648,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x380, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ctr_ChangeCtrPlcInConfig ,NULL}, /* ActChgCtrWWWCfg */{1596,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x380, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ctr_ChangeCtrWWWInConfig ,NULL}, /* ActReqCtrLog */{1244,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x380, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ctr_RequestLogo ,NULL}, /* ActRecCtrLog */{1051,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x380, 0, 0, 0,Act_CONT_DATA,Act_THIS_WINDOW,Ctr_ReceiveLogo ,Ctr_ShowConfiguration ,NULL}, @@ -4650,6 +4652,7 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un ActCreNET, // #1645 ActUpdNET, // #1646 ActRemNETCrs, // #1647 + ActChgCtrPlcCfg, // #1648 }; /*****************************************************************************/ diff --git a/swad_action.h b/swad_action.h index 3970209b..a33fa627 100644 --- a/swad_action.h +++ b/swad_action.h @@ -57,9 +57,9 @@ typedef enum typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action -#define Act_NUM_ACTIONS (1 + 9 + 43 + 17 + 47 + 32 + 24 + 115 + 72 + 416 + 165 + 172 + 42 + 14 + 97) +#define Act_NUM_ACTIONS (1 + 9 + 43 + 17 + 47 + 33 + 24 + 115 + 72 + 416 + 165 + 172 + 42 + 14 + 97) -#define Act_MAX_ACTION_COD 1647 +#define Act_MAX_ACTION_COD 1648 #define Act_MAX_OPTIONS_IN_MENU_PER_TAB 12 @@ -238,32 +238,33 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to #define ActChgCtrInsCfg (ActChgCalIns1stDay + 7) #define ActRenCtrShoCfg (ActChgCalIns1stDay + 8) #define ActRenCtrFulCfg (ActChgCalIns1stDay + 9) -#define ActChgCtrWWWCfg (ActChgCalIns1stDay + 10) -#define ActReqCtrLog (ActChgCalIns1stDay + 11) -#define ActRecCtrLog (ActChgCalIns1stDay + 12) -#define ActRemCtrLog (ActChgCalIns1stDay + 13) -#define ActReqCtrPho (ActChgCalIns1stDay + 14) -#define ActRecCtrPho (ActChgCalIns1stDay + 15) -#define ActChgCtrPhoAtt (ActChgCalIns1stDay + 16) +#define ActChgCtrPlcCfg (ActChgCalIns1stDay + 10) +#define ActChgCtrWWWCfg (ActChgCalIns1stDay + 11) +#define ActReqCtrLog (ActChgCalIns1stDay + 12) +#define ActRecCtrLog (ActChgCalIns1stDay + 13) +#define ActRemCtrLog (ActChgCalIns1stDay + 14) +#define ActReqCtrPho (ActChgCalIns1stDay + 15) +#define ActRecCtrPho (ActChgCalIns1stDay + 16) +#define ActChgCtrPhoAtt (ActChgCalIns1stDay + 17) -#define ActSeeDegTyp (ActChgCalIns1stDay + 17) -#define ActEdiDegTyp (ActChgCalIns1stDay + 18) -#define ActNewDegTyp (ActChgCalIns1stDay + 19) -#define ActRemDegTyp (ActChgCalIns1stDay + 20) -#define ActRenDegTyp (ActChgCalIns1stDay + 21) +#define ActSeeDegTyp (ActChgCalIns1stDay + 18) +#define ActEdiDegTyp (ActChgCalIns1stDay + 19) +#define ActNewDegTyp (ActChgCalIns1stDay + 20) +#define ActRemDegTyp (ActChgCalIns1stDay + 21) +#define ActRenDegTyp (ActChgCalIns1stDay + 22) -#define ActEdiDeg (ActChgCalIns1stDay + 22) -#define ActReqDeg (ActChgCalIns1stDay + 23) -#define ActNewDeg (ActChgCalIns1stDay + 24) -#define ActRemDeg (ActChgCalIns1stDay + 25) -#define ActRenDegSho (ActChgCalIns1stDay + 26) -#define ActRenDegFul (ActChgCalIns1stDay + 27) -#define ActChgDegTyp (ActChgCalIns1stDay + 28) -#define ActChgDegWWW (ActChgCalIns1stDay + 29) -#define ActChgDegSta (ActChgCalIns1stDay + 30) +#define ActEdiDeg (ActChgCalIns1stDay + 23) +#define ActReqDeg (ActChgCalIns1stDay + 24) +#define ActNewDeg (ActChgCalIns1stDay + 25) +#define ActRemDeg (ActChgCalIns1stDay + 26) +#define ActRenDegSho (ActChgCalIns1stDay + 27) +#define ActRenDegFul (ActChgCalIns1stDay + 28) +#define ActChgDegTyp (ActChgCalIns1stDay + 29) +#define ActChgDegWWW (ActChgCalIns1stDay + 30) +#define ActChgDegSta (ActChgCalIns1stDay + 31) -#define ActPrnCalCtr (ActChgCalIns1stDay + 31) -#define ActChgCalCtr1stDay (ActChgCalIns1stDay + 32) +#define ActPrnCalCtr (ActChgCalIns1stDay + 32) +#define ActChgCalCtr1stDay (ActChgCalIns1stDay + 33) /*****************************************************************************/ /********************************* Degree tab ********************************/ diff --git a/swad_centre.c b/swad_centre.c index c96cb3c6..2cd4edd1 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -103,6 +103,7 @@ static Ctr_Status_t Ctr_GetStatusBitsFromStatusTxt (Ctr_StatusTxt_t StatusTxt); static void Ctr_PutParamOtherCtrCod (long CtrCod); static void Ctr_UpdateCtrInsDB (long CtrCod,long InsCod); +static void Ctr_UpdateCtrPlcDB (long CtrCod,long NewPlcCod); static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName); static bool Ctr_CheckIfCtrNameExistsInIns (const char *FieldName,const char *Name,long CtrCod,long InsCod); @@ -285,6 +286,7 @@ static void Ctr_Configuration (bool PrintView) extern const char *Txt_Institution; extern const char *Txt_Centre; extern const char *Txt_Short_name; + extern const char *Txt_Another_place; extern const char *Txt_Web; extern const char *Txt_Shortcut; extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; @@ -295,6 +297,7 @@ static void Ctr_Configuration (bool PrintView) extern const char *Txt_Degrees_of_CENTRE_X; extern const char *Txt_Courses; unsigned NumIns; + unsigned NumPlc; struct Place Plc; char PathPhoto[PATH_MAX + 1]; bool PhotoExists; @@ -490,12 +493,59 @@ static void Ctr_Configuration (bool PrintView) fprintf (Gbl.F.Out,"" ""); + /***** Place *****/ + Plc.PlcCod = Gbl.CurrentCtr.Ctr.PlcCod; + Plc_GetDataOfPlaceByCod (&Plc); + fprintf (Gbl.F.Out,"