diff --git a/swad_action.c b/swad_action.c index 8c966cdb0..1f1c8dad6 100644 --- a/swad_action.c +++ b/swad_action.c @@ -191,7 +191,6 @@ Institution: 90. ActReqCtr Request the creation of a request for a new centre (a teacher makes the petition to an administrator) 91. ActNewCtr Request the creation of a centre 92. ActRemCtr Remove centre - 93. ActChgCtrIns Request change of the institution of a centre 94. ActChgCtrPlc Request change of the place of a centre 95. ActRenCtrSho Change short name centre 96. ActRenCtrFul Change full name centre @@ -1539,7 +1538,6 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActReqCtr */{1208,-1,TabIns,ActSeeCtr ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ctr_RecFormReqCtr ,NULL}, /* ActNewCtr */{ 685,-1,TabIns,ActSeeCtr ,0x180,0x180,0x180,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ctr_RecFormNewCtr ,NULL}, /* ActRemCtr */{ 686,-1,TabIns,ActSeeCtr ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ctr_RemoveCentre ,NULL}, - /* ActChgCtrIns */{ 720,-1,TabIns,ActSeeCtr ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ctr_ChangeCentreIns ,NULL}, /* ActChgDegPlc */{ 706,-1,TabIns,ActSeeCtr ,0x180,0x180,0x180,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ctr_ChangeCentrePlace ,NULL}, /* ActRenCtrSho */{ 682,-1,TabIns,ActSeeCtr ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Ctr_RenameCentreShort ,Ctr_ContEditAfterChgCtr ,NULL}, /* ActRenCtrFul */{ 684,-1,TabIns,ActSeeCtr ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Ctr_RenameCentreFull ,Ctr_ContEditAfterChgCtr ,NULL}, @@ -3572,7 +3570,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq ActChgHldStrDat, // #717 ActChgHldEndDat, // #718 -1, // #719 (obsolete action) - ActChgCtrIns, // #720 + -1, // #720 (obsolete action) ActChgDptIns, // #721 -1, // #722 (obsolete action) ActSeeForGenTch, // #723 diff --git a/swad_action.h b/swad_action.h index aa7b7e729..57f11079e 100644 --- a/swad_action.h +++ b/swad_action.h @@ -55,7 +55,7 @@ typedef enum typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action -#define Act_NUM_ACTIONS (1+9+51+15+91+70+67+247+186+155+172+36+30+86) +#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+247+186+155+172+36+30+86) #define Act_MAX_ACTION_COD 1590 @@ -191,84 +191,83 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica #define ActReqCtr (ActChgInsSta+ 16) #define ActNewCtr (ActChgInsSta+ 17) #define ActRemCtr (ActChgInsSta+ 18) -#define ActChgCtrIns (ActChgInsSta+ 19) -#define ActChgCtrPlc (ActChgInsSta+ 20) -#define ActRenCtrSho (ActChgInsSta+ 21) -#define ActRenCtrFul (ActChgInsSta+ 22) -#define ActChgCtrWWW (ActChgInsSta+ 23) -#define ActChgCtrSta (ActChgInsSta+ 24) +#define ActChgCtrPlc (ActChgInsSta+ 19) +#define ActRenCtrSho (ActChgInsSta+ 20) +#define ActRenCtrFul (ActChgInsSta+ 21) +#define ActChgCtrWWW (ActChgInsSta+ 22) +#define ActChgCtrSta (ActChgInsSta+ 23) -#define ActEdiDpt (ActChgInsSta+ 25) -#define ActNewDpt (ActChgInsSta+ 26) -#define ActRemDpt (ActChgInsSta+ 27) -#define ActChgDptIns (ActChgInsSta+ 28) -#define ActRenDptSho (ActChgInsSta+ 29) -#define ActRenDptFul (ActChgInsSta+ 30) -#define ActChgDptWWW (ActChgInsSta+ 31) +#define ActEdiDpt (ActChgInsSta+ 24) +#define ActNewDpt (ActChgInsSta+ 25) +#define ActRemDpt (ActChgInsSta+ 26) +#define ActChgDptIns (ActChgInsSta+ 27) +#define ActRenDptSho (ActChgInsSta+ 28) +#define ActRenDptFul (ActChgInsSta+ 29) +#define ActChgDptWWW (ActChgInsSta+ 30) -#define ActEdiPlc (ActChgInsSta+ 32) -#define ActNewPlc (ActChgInsSta+ 33) -#define ActRemPlc (ActChgInsSta+ 34) -#define ActRenPlcSho (ActChgInsSta+ 35) -#define ActRenPlcFul (ActChgInsSta+ 36) +#define ActEdiPlc (ActChgInsSta+ 31) +#define ActNewPlc (ActChgInsSta+ 32) +#define ActRemPlc (ActChgInsSta+ 33) +#define ActRenPlcSho (ActChgInsSta+ 34) +#define ActRenPlcFul (ActChgInsSta+ 35) -#define ActEdiHld (ActChgInsSta+ 37) -#define ActNewHld (ActChgInsSta+ 38) -#define ActRemHld (ActChgInsSta+ 39) -#define ActChgHldPlc (ActChgInsSta+ 40) -#define ActChgHldTyp (ActChgInsSta+ 41) -#define ActChgHldStrDat (ActChgInsSta+ 42) -#define ActChgHldEndDat (ActChgInsSta+ 43) -#define ActRenHld (ActChgInsSta+ 44) +#define ActEdiHld (ActChgInsSta+ 36) +#define ActNewHld (ActChgInsSta+ 37) +#define ActRemHld (ActChgInsSta+ 38) +#define ActChgHldPlc (ActChgInsSta+ 39) +#define ActChgHldTyp (ActChgInsSta+ 40) +#define ActChgHldStrDat (ActChgInsSta+ 41) +#define ActChgHldEndDat (ActChgInsSta+ 42) +#define ActRenHld (ActChgInsSta+ 43) -#define ActChgToSeeDocIns (ActChgInsSta+ 45) -#define ActSeeDocIns (ActChgInsSta+ 46) -#define ActExpSeeDocIns (ActChgInsSta+ 47) -#define ActConSeeDocIns (ActChgInsSta+ 48) -#define ActZIPSeeDocIns (ActChgInsSta+ 49) -#define ActReqDatSeeDocIns (ActChgInsSta+ 50) -#define ActDowSeeDocIns (ActChgInsSta+ 51) -#define ActChgToAdmDocIns (ActChgInsSta+ 52) -#define ActAdmDocIns (ActChgInsSta+ 53) -#define ActReqRemFilDocIns (ActChgInsSta+ 54) -#define ActRemFilDocIns (ActChgInsSta+ 55) -#define ActRemFolDocIns (ActChgInsSta+ 56) -#define ActCopDocIns (ActChgInsSta+ 57) -#define ActPasDocIns (ActChgInsSta+ 58) -#define ActRemTreDocIns (ActChgInsSta+ 59) -#define ActFrmCreDocIns (ActChgInsSta+ 60) -#define ActCreFolDocIns (ActChgInsSta+ 61) -#define ActCreLnkDocIns (ActChgInsSta+ 62) -#define ActRenFolDocIns (ActChgInsSta+ 63) -#define ActRcvFilDocInsDZ (ActChgInsSta+ 64) -#define ActRcvFilDocInsCla (ActChgInsSta+ 65) -#define ActExpAdmDocIns (ActChgInsSta+ 66) -#define ActConAdmDocIns (ActChgInsSta+ 67) -#define ActZIPAdmDocIns (ActChgInsSta+ 68) -#define ActShoDocIns (ActChgInsSta+ 69) -#define ActHidDocIns (ActChgInsSta+ 70) -#define ActReqDatAdmDocIns (ActChgInsSta+ 71) -#define ActChgDatAdmDocIns (ActChgInsSta+ 72) -#define ActDowAdmDocIns (ActChgInsSta+ 73) +#define ActChgToSeeDocIns (ActChgInsSta+ 44) +#define ActSeeDocIns (ActChgInsSta+ 45) +#define ActExpSeeDocIns (ActChgInsSta+ 46) +#define ActConSeeDocIns (ActChgInsSta+ 47) +#define ActZIPSeeDocIns (ActChgInsSta+ 48) +#define ActReqDatSeeDocIns (ActChgInsSta+ 49) +#define ActDowSeeDocIns (ActChgInsSta+ 50) +#define ActChgToAdmDocIns (ActChgInsSta+ 51) +#define ActAdmDocIns (ActChgInsSta+ 52) +#define ActReqRemFilDocIns (ActChgInsSta+ 53) +#define ActRemFilDocIns (ActChgInsSta+ 54) +#define ActRemFolDocIns (ActChgInsSta+ 55) +#define ActCopDocIns (ActChgInsSta+ 56) +#define ActPasDocIns (ActChgInsSta+ 57) +#define ActRemTreDocIns (ActChgInsSta+ 58) +#define ActFrmCreDocIns (ActChgInsSta+ 59) +#define ActCreFolDocIns (ActChgInsSta+ 60) +#define ActCreLnkDocIns (ActChgInsSta+ 61) +#define ActRenFolDocIns (ActChgInsSta+ 62) +#define ActRcvFilDocInsDZ (ActChgInsSta+ 63) +#define ActRcvFilDocInsCla (ActChgInsSta+ 64) +#define ActExpAdmDocIns (ActChgInsSta+ 65) +#define ActConAdmDocIns (ActChgInsSta+ 66) +#define ActZIPAdmDocIns (ActChgInsSta+ 67) +#define ActShoDocIns (ActChgInsSta+ 68) +#define ActHidDocIns (ActChgInsSta+ 69) +#define ActReqDatAdmDocIns (ActChgInsSta+ 70) +#define ActChgDatAdmDocIns (ActChgInsSta+ 71) +#define ActDowAdmDocIns (ActChgInsSta+ 72) -#define ActReqRemFilShaIns (ActChgInsSta+ 74) -#define ActRemFilShaIns (ActChgInsSta+ 75) -#define ActRemFolShaIns (ActChgInsSta+ 76) -#define ActCopShaIns (ActChgInsSta+ 77) -#define ActPasShaIns (ActChgInsSta+ 78) -#define ActRemTreShaIns (ActChgInsSta+ 79) -#define ActFrmCreShaIns (ActChgInsSta+ 80) -#define ActCreFolShaIns (ActChgInsSta+ 81) -#define ActCreLnkShaIns (ActChgInsSta+ 82) -#define ActRenFolShaIns (ActChgInsSta+ 83) -#define ActRcvFilShaInsDZ (ActChgInsSta+ 84) -#define ActRcvFilShaInsCla (ActChgInsSta+ 85) -#define ActExpShaIns (ActChgInsSta+ 86) -#define ActConShaIns (ActChgInsSta+ 87) -#define ActZIPShaIns (ActChgInsSta+ 88) -#define ActReqDatShaIns (ActChgInsSta+ 89) -#define ActChgDatShaIns (ActChgInsSta+ 90) -#define ActDowShaIns (ActChgInsSta+ 91) +#define ActReqRemFilShaIns (ActChgInsSta+ 73) +#define ActRemFilShaIns (ActChgInsSta+ 74) +#define ActRemFolShaIns (ActChgInsSta+ 75) +#define ActCopShaIns (ActChgInsSta+ 76) +#define ActPasShaIns (ActChgInsSta+ 77) +#define ActRemTreShaIns (ActChgInsSta+ 78) +#define ActFrmCreShaIns (ActChgInsSta+ 79) +#define ActCreFolShaIns (ActChgInsSta+ 80) +#define ActCreLnkShaIns (ActChgInsSta+ 81) +#define ActRenFolShaIns (ActChgInsSta+ 82) +#define ActRcvFilShaInsDZ (ActChgInsSta+ 83) +#define ActRcvFilShaInsCla (ActChgInsSta+ 84) +#define ActExpShaIns (ActChgInsSta+ 85) +#define ActConShaIns (ActChgInsSta+ 86) +#define ActZIPShaIns (ActChgInsSta+ 87) +#define ActReqDatShaIns (ActChgInsSta+ 88) +#define ActChgDatShaIns (ActChgInsSta+ 89) +#define ActDowShaIns (ActChgInsSta+ 90) /*****************************************************************************/ /********************************* Centre tab ********************************/ diff --git a/swad_centre.c b/swad_centre.c index 8060a0364..9b608d0c1 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -848,40 +848,24 @@ static void Ctr_GetParamCtrOrderType (void) void Ctr_EditCentres (void) { - extern const char *Txt_There_is_no_list_of_institutions; - extern const char *Txt_You_must_create_at_least_one_institution_before_creating_centres; + /***** Get list of places *****/ + Plc_GetListPlaces (); - /***** Get list of institutions of the current country *****/ - Ins_GetListInstitutions (Gbl.CurrentCty.Cty.CtyCod,Ins_GET_BASIC_DATA); - if (Gbl.Inss.Num) - { - /***** Get list of places *****/ - Plc_GetListPlaces (); + /***** Get list of centres *****/ + Ctr_GetListCentres (Gbl.CurrentIns.Ins.InsCod); - /***** Get list of centres *****/ - Ctr_GetListCentres (Gbl.CurrentIns.Ins.InsCod); + /***** Put a form to create a new centre *****/ + Ctr_PutFormToCreateCentre (); - /***** Put a form to create a new centre *****/ - Ctr_PutFormToCreateCentre (); + /***** List current centres *****/ + if (Gbl.Ctrs.Num) + Ctr_ListCentresForEdition (); - /***** List current centres *****/ - if (Gbl.Ctrs.Num) - Ctr_ListCentresForEdition (); + /***** Free list of centres *****/ + Ctr_FreeListCentres (); - /***** Free list of centres *****/ - Ctr_FreeListCentres (); - - /***** Free list of places *****/ - Plc_FreeListPlaces (); - } - else // No institutions - { - Lay_ShowAlert (Lay_WARNING,Txt_There_is_no_list_of_institutions); - Lay_ShowAlert (Lay_INFO,Txt_You_must_create_at_least_one_institution_before_creating_centres); - } - - /***** Free list of institutions *****/ - Ins_FreeListInstitutions (); + /***** Free list of places *****/ + Plc_FreeListPlaces (); } /*****************************************************************************/ @@ -1297,8 +1281,6 @@ static void Ctr_ListCentresForEdition (void) extern const char *Txt_CENTRE_STATUS[Ctr_NUM_STATUS_TXT]; unsigned NumCtr; struct Centre *Ctr; - struct Institution Ins; - unsigned NumIns; unsigned NumPlc; char WWW[Ctr_MAX_LENGTH_WWW_ON_SCREEN+1]; struct UsrData UsrDat; @@ -1321,10 +1303,6 @@ static void Ctr_ListCentresForEdition (void) { Ctr = &Gbl.Ctrs.Lst[NumCtr]; - /* Get data of institution of this centre */ - Ins.InsCod = Ctr->InsCod; - Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA); - ICanEdit = Ctr_CheckIfICanEdit (Ctr); /* Put icon to remove centre */ @@ -1357,30 +1335,6 @@ static void Ctr_ListCentresForEdition (void) Log_DrawLogo (Sco_SCOPE_CTR,Ctr->CtrCod,Ctr->ShortName,20,NULL,true); fprintf (Gbl.F.Out,""); - /* Institution */ - fprintf (Gbl.F.Out,""); - if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) // I can select institution - { - Act_FormStart (ActChgCtrIns); - Ctr_PutParamOtherCtrCod (Ctr->CtrCod); - fprintf (Gbl.F.Out,""); - Act_FormEnd (); - } - else - fprintf (Gbl.F.Out,"%s",Gbl.CurrentIns.Ins.ShortName); - fprintf (Gbl.F.Out,""); - /* Place */ fprintf (Gbl.F.Out,""); if (ICanEdit) @@ -1736,46 +1690,6 @@ void Ctr_ContEditAfterChgCtrInConfig (void) Ctr_ShowConfiguration (); } -/*****************************************************************************/ -/********************* Change the institution of a centre ********************/ -/*****************************************************************************/ - -void Ctr_ChangeCentreIns (void) - { - extern const char *Txt_The_centre_X_has_been_moved_to_the_institution_Y; - struct Centre *Ctr; - struct Institution NewIns; - - Ctr = &Gbl.Ctrs.EditingCtr; - - /***** Get parameters from form *****/ - /* Get the code of the centre */ - if ((Ctr->CtrCod = Ctr_GetParamOtherCtrCod ()) < 0) - Lay_ShowErrorAndExit ("Code of centre is missing."); - - /* Get parameter with institution code */ - NewIns.InsCod = Ins_GetParamOtherInsCod (); - - /***** Get data of centre and new institution *****/ - Ctr_GetDataOfCentreByCod (Ctr); - Ins_GetDataOfInstitutionByCod (&NewIns,Ins_GET_BASIC_DATA); - - /***** Update institution in table of centres *****/ - Ctr_UpdateCtrInsDB (Ctr->CtrCod,NewIns.InsCod); - Ctr->InsCod = NewIns.InsCod; - - /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_The_centre_X_has_been_moved_to_the_institution_Y, - Ctr->FullName,NewIns.FullName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); - - /***** Put button to go to centre changed *****/ - Ctr_PutButtonToGoToCtr (Ctr); - - /***** Show the form again *****/ - Ctr_EditCentres (); - } - /*****************************************************************************/ /******************* Update institution in table of centres ******************/ /*****************************************************************************/ @@ -2374,18 +2288,6 @@ static void Ctr_PutFormToCreateCentre (void) Log_DrawLogo (Sco_SCOPE_CTR,-1L,"",20,NULL,true); fprintf (Gbl.F.Out,""); - /***** Institution *****/ - fprintf (Gbl.F.Out,"" - "" - "", - Gbl.CurrentIns.Ins.InsCod, - Gbl.CurrentIns.Ins.ShortName); - /***** Place *****/ fprintf (Gbl.F.Out,"" "