mirror of https://github.com/acanas/swad-core.git
Version 21.105: Jul 14, 2022 Removing resource from program item.
This commit is contained in:
parent
89ed686681
commit
a87d0d26d4
|
@ -444,6 +444,7 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
||||||
|
|
||||||
[ActFrmNewPrgRsc ] = {1918,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RequestChangeItem ,NULL},
|
[ActFrmNewPrgRsc ] = {1918,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RequestChangeItem ,NULL},
|
||||||
[ActReqRemPrgRsc ] = {1919,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,PrgRsc_ReqRemResource ,NULL},
|
[ActReqRemPrgRsc ] = {1919,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,PrgRsc_ReqRemResource ,NULL},
|
||||||
|
[ActRemPrgRsc ] = {1920,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,PrgRsc_RemoveResource ,NULL},
|
||||||
|
|
||||||
[ActEdiTchGui ] = { 785,-1,TabUnk,ActSeeTchGui ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_FormsToSelSendInfo ,NULL},
|
[ActEdiTchGui ] = { 785,-1,TabUnk,ActSeeTchGui ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_FormsToSelSendInfo ,NULL},
|
||||||
|
|
||||||
|
@ -3749,6 +3750,7 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
|
||||||
ActChgUsrPho, // #1917
|
ActChgUsrPho, // #1917
|
||||||
ActFrmNewPrgRsc, // #1918
|
ActFrmNewPrgRsc, // #1918
|
||||||
ActReqRemPrgRsc, // #1919
|
ActReqRemPrgRsc, // #1919
|
||||||
|
ActRemPrgRsc, // #1920
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
195
swad_action.h
195
swad_action.h
|
@ -65,7 +65,7 @@ typedef enum
|
||||||
|
|
||||||
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
||||||
|
|
||||||
#define Act_MAX_ACTION_COD 1919
|
#define Act_MAX_ACTION_COD 1920
|
||||||
|
|
||||||
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13
|
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13
|
||||||
|
|
||||||
|
@ -410,107 +410,108 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
|
||||||
#define ActRgtPrgItm (ActChgCrsSta + 27)
|
#define ActRgtPrgItm (ActChgCrsSta + 27)
|
||||||
#define ActFrmNewPrgRsc (ActChgCrsSta + 28)
|
#define ActFrmNewPrgRsc (ActChgCrsSta + 28)
|
||||||
#define ActReqRemPrgRsc (ActChgCrsSta + 29)
|
#define ActReqRemPrgRsc (ActChgCrsSta + 29)
|
||||||
#define ActEdiTchGui (ActChgCrsSta + 30)
|
#define ActRemPrgRsc (ActChgCrsSta + 30)
|
||||||
#define ActSeeSylLec (ActChgCrsSta + 31)
|
#define ActEdiTchGui (ActChgCrsSta + 31)
|
||||||
#define ActSeeSylPra (ActChgCrsSta + 32)
|
#define ActSeeSylLec (ActChgCrsSta + 32)
|
||||||
#define ActEdiSylLec (ActChgCrsSta + 33)
|
#define ActSeeSylPra (ActChgCrsSta + 33)
|
||||||
#define ActEdiSylPra (ActChgCrsSta + 34)
|
#define ActEdiSylLec (ActChgCrsSta + 34)
|
||||||
#define ActDelItmSylLec (ActChgCrsSta + 35)
|
#define ActEdiSylPra (ActChgCrsSta + 35)
|
||||||
#define ActDelItmSylPra (ActChgCrsSta + 36)
|
#define ActDelItmSylLec (ActChgCrsSta + 36)
|
||||||
#define ActUp_IteSylLec (ActChgCrsSta + 37)
|
#define ActDelItmSylPra (ActChgCrsSta + 37)
|
||||||
#define ActUp_IteSylPra (ActChgCrsSta + 38)
|
#define ActUp_IteSylLec (ActChgCrsSta + 38)
|
||||||
#define ActDwnIteSylLec (ActChgCrsSta + 39)
|
#define ActUp_IteSylPra (ActChgCrsSta + 39)
|
||||||
#define ActDwnIteSylPra (ActChgCrsSta + 40)
|
#define ActDwnIteSylLec (ActChgCrsSta + 40)
|
||||||
#define ActRgtIteSylLec (ActChgCrsSta + 41)
|
#define ActDwnIteSylPra (ActChgCrsSta + 41)
|
||||||
#define ActRgtIteSylPra (ActChgCrsSta + 42)
|
#define ActRgtIteSylLec (ActChgCrsSta + 42)
|
||||||
#define ActLftIteSylLec (ActChgCrsSta + 43)
|
#define ActRgtIteSylPra (ActChgCrsSta + 43)
|
||||||
#define ActLftIteSylPra (ActChgCrsSta + 44)
|
#define ActLftIteSylLec (ActChgCrsSta + 44)
|
||||||
#define ActInsIteSylLec (ActChgCrsSta + 45)
|
#define ActLftIteSylPra (ActChgCrsSta + 45)
|
||||||
#define ActInsIteSylPra (ActChgCrsSta + 46)
|
#define ActInsIteSylLec (ActChgCrsSta + 46)
|
||||||
#define ActModIteSylLec (ActChgCrsSta + 47)
|
#define ActInsIteSylPra (ActChgCrsSta + 47)
|
||||||
#define ActModIteSylPra (ActChgCrsSta + 48)
|
#define ActModIteSylLec (ActChgCrsSta + 48)
|
||||||
|
#define ActModIteSylPra (ActChgCrsSta + 49)
|
||||||
|
|
||||||
#define ActEdiBib (ActChgCrsSta + 49)
|
#define ActEdiBib (ActChgCrsSta + 50)
|
||||||
#define ActEdiFAQ (ActChgCrsSta + 50)
|
#define ActEdiFAQ (ActChgCrsSta + 51)
|
||||||
#define ActEdiCrsLnk (ActChgCrsSta + 51)
|
#define ActEdiCrsLnk (ActChgCrsSta + 52)
|
||||||
|
|
||||||
#define ActChgFrcReaCrsInf (ActChgCrsSta + 52)
|
#define ActChgFrcReaCrsInf (ActChgCrsSta + 53)
|
||||||
#define ActChgFrcReaTchGui (ActChgCrsSta + 53)
|
#define ActChgFrcReaTchGui (ActChgCrsSta + 54)
|
||||||
#define ActChgFrcReaSylLec (ActChgCrsSta + 54)
|
#define ActChgFrcReaSylLec (ActChgCrsSta + 55)
|
||||||
#define ActChgFrcReaSylPra (ActChgCrsSta + 55)
|
#define ActChgFrcReaSylPra (ActChgCrsSta + 56)
|
||||||
#define ActChgFrcReaBib (ActChgCrsSta + 56)
|
#define ActChgFrcReaBib (ActChgCrsSta + 57)
|
||||||
#define ActChgFrcReaFAQ (ActChgCrsSta + 57)
|
#define ActChgFrcReaFAQ (ActChgCrsSta + 58)
|
||||||
#define ActChgFrcReaCrsLnk (ActChgCrsSta + 58)
|
#define ActChgFrcReaCrsLnk (ActChgCrsSta + 59)
|
||||||
|
|
||||||
#define ActChgHavReaCrsInf (ActChgCrsSta + 59)
|
#define ActChgHavReaCrsInf (ActChgCrsSta + 60)
|
||||||
#define ActChgHavReaTchGui (ActChgCrsSta + 60)
|
#define ActChgHavReaTchGui (ActChgCrsSta + 61)
|
||||||
#define ActChgHavReaSylLec (ActChgCrsSta + 61)
|
#define ActChgHavReaSylLec (ActChgCrsSta + 62)
|
||||||
#define ActChgHavReaSylPra (ActChgCrsSta + 62)
|
#define ActChgHavReaSylPra (ActChgCrsSta + 63)
|
||||||
#define ActChgHavReaBib (ActChgCrsSta + 63)
|
#define ActChgHavReaBib (ActChgCrsSta + 64)
|
||||||
#define ActChgHavReaFAQ (ActChgCrsSta + 64)
|
#define ActChgHavReaFAQ (ActChgCrsSta + 65)
|
||||||
#define ActChgHavReaCrsLnk (ActChgCrsSta + 65)
|
#define ActChgHavReaCrsLnk (ActChgCrsSta + 66)
|
||||||
|
|
||||||
#define ActSelInfSrcCrsInf (ActChgCrsSta + 66)
|
#define ActSelInfSrcCrsInf (ActChgCrsSta + 67)
|
||||||
#define ActSelInfSrcTchGui (ActChgCrsSta + 67)
|
#define ActSelInfSrcTchGui (ActChgCrsSta + 68)
|
||||||
#define ActSelInfSrcSylLec (ActChgCrsSta + 68)
|
#define ActSelInfSrcSylLec (ActChgCrsSta + 69)
|
||||||
#define ActSelInfSrcSylPra (ActChgCrsSta + 69)
|
#define ActSelInfSrcSylPra (ActChgCrsSta + 70)
|
||||||
#define ActSelInfSrcBib (ActChgCrsSta + 70)
|
#define ActSelInfSrcBib (ActChgCrsSta + 71)
|
||||||
#define ActSelInfSrcFAQ (ActChgCrsSta + 71)
|
#define ActSelInfSrcFAQ (ActChgCrsSta + 72)
|
||||||
#define ActSelInfSrcCrsLnk (ActChgCrsSta + 72)
|
#define ActSelInfSrcCrsLnk (ActChgCrsSta + 73)
|
||||||
#define ActRcvURLCrsInf (ActChgCrsSta + 73)
|
#define ActRcvURLCrsInf (ActChgCrsSta + 74)
|
||||||
#define ActRcvURLTchGui (ActChgCrsSta + 74)
|
#define ActRcvURLTchGui (ActChgCrsSta + 75)
|
||||||
#define ActRcvURLSylLec (ActChgCrsSta + 75)
|
#define ActRcvURLSylLec (ActChgCrsSta + 76)
|
||||||
#define ActRcvURLSylPra (ActChgCrsSta + 76)
|
#define ActRcvURLSylPra (ActChgCrsSta + 77)
|
||||||
#define ActRcvURLBib (ActChgCrsSta + 77)
|
#define ActRcvURLBib (ActChgCrsSta + 78)
|
||||||
#define ActRcvURLFAQ (ActChgCrsSta + 78)
|
#define ActRcvURLFAQ (ActChgCrsSta + 79)
|
||||||
#define ActRcvURLCrsLnk (ActChgCrsSta + 79)
|
#define ActRcvURLCrsLnk (ActChgCrsSta + 80)
|
||||||
#define ActRcvPagCrsInf (ActChgCrsSta + 80)
|
#define ActRcvPagCrsInf (ActChgCrsSta + 81)
|
||||||
#define ActRcvPagTchGui (ActChgCrsSta + 81)
|
#define ActRcvPagTchGui (ActChgCrsSta + 82)
|
||||||
#define ActRcvPagSylLec (ActChgCrsSta + 82)
|
#define ActRcvPagSylLec (ActChgCrsSta + 83)
|
||||||
#define ActRcvPagSylPra (ActChgCrsSta + 83)
|
#define ActRcvPagSylPra (ActChgCrsSta + 84)
|
||||||
#define ActRcvPagBib (ActChgCrsSta + 84)
|
#define ActRcvPagBib (ActChgCrsSta + 85)
|
||||||
#define ActRcvPagFAQ (ActChgCrsSta + 85)
|
#define ActRcvPagFAQ (ActChgCrsSta + 86)
|
||||||
#define ActRcvPagCrsLnk (ActChgCrsSta + 86)
|
#define ActRcvPagCrsLnk (ActChgCrsSta + 87)
|
||||||
#define ActEditorCrsInf (ActChgCrsSta + 87)
|
#define ActEditorCrsInf (ActChgCrsSta + 88)
|
||||||
#define ActEditorTchGui (ActChgCrsSta + 88)
|
#define ActEditorTchGui (ActChgCrsSta + 89)
|
||||||
#define ActEditorSylLec (ActChgCrsSta + 89)
|
#define ActEditorSylLec (ActChgCrsSta + 90)
|
||||||
#define ActEditorSylPra (ActChgCrsSta + 90)
|
#define ActEditorSylPra (ActChgCrsSta + 91)
|
||||||
#define ActEditorBib (ActChgCrsSta + 91)
|
#define ActEditorBib (ActChgCrsSta + 92)
|
||||||
#define ActEditorFAQ (ActChgCrsSta + 92)
|
#define ActEditorFAQ (ActChgCrsSta + 93)
|
||||||
#define ActEditorCrsLnk (ActChgCrsSta + 93)
|
#define ActEditorCrsLnk (ActChgCrsSta + 94)
|
||||||
#define ActPlaTxtEdiCrsInf (ActChgCrsSta + 94)
|
#define ActPlaTxtEdiCrsInf (ActChgCrsSta + 95)
|
||||||
#define ActPlaTxtEdiTchGui (ActChgCrsSta + 95)
|
#define ActPlaTxtEdiTchGui (ActChgCrsSta + 96)
|
||||||
#define ActPlaTxtEdiSylLec (ActChgCrsSta + 96)
|
#define ActPlaTxtEdiSylLec (ActChgCrsSta + 97)
|
||||||
#define ActPlaTxtEdiSylPra (ActChgCrsSta + 97)
|
#define ActPlaTxtEdiSylPra (ActChgCrsSta + 98)
|
||||||
#define ActPlaTxtEdiBib (ActChgCrsSta + 98)
|
#define ActPlaTxtEdiBib (ActChgCrsSta + 99)
|
||||||
#define ActPlaTxtEdiFAQ (ActChgCrsSta + 99)
|
#define ActPlaTxtEdiFAQ (ActChgCrsSta + 100)
|
||||||
#define ActPlaTxtEdiCrsLnk (ActChgCrsSta + 100)
|
#define ActPlaTxtEdiCrsLnk (ActChgCrsSta + 101)
|
||||||
#define ActRchTxtEdiCrsInf (ActChgCrsSta + 101)
|
#define ActRchTxtEdiCrsInf (ActChgCrsSta + 102)
|
||||||
#define ActRchTxtEdiTchGui (ActChgCrsSta + 102)
|
#define ActRchTxtEdiTchGui (ActChgCrsSta + 103)
|
||||||
#define ActRchTxtEdiSylLec (ActChgCrsSta + 103)
|
#define ActRchTxtEdiSylLec (ActChgCrsSta + 104)
|
||||||
#define ActRchTxtEdiSylPra (ActChgCrsSta + 104)
|
#define ActRchTxtEdiSylPra (ActChgCrsSta + 105)
|
||||||
#define ActRchTxtEdiBib (ActChgCrsSta + 105)
|
#define ActRchTxtEdiBib (ActChgCrsSta + 106)
|
||||||
#define ActRchTxtEdiFAQ (ActChgCrsSta + 106)
|
#define ActRchTxtEdiFAQ (ActChgCrsSta + 107)
|
||||||
#define ActRchTxtEdiCrsLnk (ActChgCrsSta + 107)
|
#define ActRchTxtEdiCrsLnk (ActChgCrsSta + 108)
|
||||||
#define ActRcvPlaTxtCrsInf (ActChgCrsSta + 108)
|
#define ActRcvPlaTxtCrsInf (ActChgCrsSta + 109)
|
||||||
#define ActRcvPlaTxtTchGui (ActChgCrsSta + 109)
|
#define ActRcvPlaTxtTchGui (ActChgCrsSta + 110)
|
||||||
#define ActRcvPlaTxtSylLec (ActChgCrsSta + 110)
|
#define ActRcvPlaTxtSylLec (ActChgCrsSta + 111)
|
||||||
#define ActRcvPlaTxtSylPra (ActChgCrsSta + 111)
|
#define ActRcvPlaTxtSylPra (ActChgCrsSta + 112)
|
||||||
#define ActRcvPlaTxtBib (ActChgCrsSta + 112)
|
#define ActRcvPlaTxtBib (ActChgCrsSta + 113)
|
||||||
#define ActRcvPlaTxtFAQ (ActChgCrsSta + 113)
|
#define ActRcvPlaTxtFAQ (ActChgCrsSta + 114)
|
||||||
#define ActRcvPlaTxtCrsLnk (ActChgCrsSta + 114)
|
#define ActRcvPlaTxtCrsLnk (ActChgCrsSta + 115)
|
||||||
#define ActRcvRchTxtCrsInf (ActChgCrsSta + 115)
|
#define ActRcvRchTxtCrsInf (ActChgCrsSta + 116)
|
||||||
#define ActRcvRchTxtTchGui (ActChgCrsSta + 116)
|
#define ActRcvRchTxtTchGui (ActChgCrsSta + 117)
|
||||||
#define ActRcvRchTxtSylLec (ActChgCrsSta + 117)
|
#define ActRcvRchTxtSylLec (ActChgCrsSta + 118)
|
||||||
#define ActRcvRchTxtSylPra (ActChgCrsSta + 118)
|
#define ActRcvRchTxtSylPra (ActChgCrsSta + 119)
|
||||||
#define ActRcvRchTxtBib (ActChgCrsSta + 119)
|
#define ActRcvRchTxtBib (ActChgCrsSta + 120)
|
||||||
#define ActRcvRchTxtFAQ (ActChgCrsSta + 120)
|
#define ActRcvRchTxtFAQ (ActChgCrsSta + 121)
|
||||||
#define ActRcvRchTxtCrsLnk (ActChgCrsSta + 121)
|
#define ActRcvRchTxtCrsLnk (ActChgCrsSta + 122)
|
||||||
|
|
||||||
#define ActPrnCrsTT (ActChgCrsSta + 122)
|
#define ActPrnCrsTT (ActChgCrsSta + 123)
|
||||||
#define ActEdiCrsTT (ActChgCrsSta + 123)
|
#define ActEdiCrsTT (ActChgCrsSta + 124)
|
||||||
#define ActChgCrsTT (ActChgCrsSta + 124)
|
#define ActChgCrsTT (ActChgCrsSta + 125)
|
||||||
#define ActChgCrsTT1stDay (ActChgCrsSta + 125)
|
#define ActChgCrsTT1stDay (ActChgCrsSta + 126)
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************************** Assessment tab ********************************/
|
/***************************** Assessment tab ********************************/
|
||||||
|
|
|
@ -137,7 +137,7 @@ void Ale_ResetAllAlerts (void)
|
||||||
|
|
||||||
static void Ale_ResetLastAlert (void)
|
static void Ale_ResetLastAlert (void)
|
||||||
{
|
{
|
||||||
if (Gbl.Alerts.Num) // There are pending alerts no shown
|
if (Gbl.Alerts.Num) // There are pending alerts not shown
|
||||||
Ale_ResetAlert (Gbl.Alerts.Num - 1); // Reset the last one
|
Ale_ResetAlert (Gbl.Alerts.Num - 1); // Reset the last one
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -341,7 +341,7 @@ void Cfe_ReceiveCallForExam1 (void)
|
||||||
Frm_SetAnchorStr (ExaCod,&Anchor);
|
Frm_SetAnchorStr (ExaCod,&Anchor);
|
||||||
Ale_CreateAlert (Ale_SUCCESS,Anchor,
|
Ale_CreateAlert (Ale_SUCCESS,Anchor,
|
||||||
NewCallForExam ? Txt_Created_new_call_for_exam :
|
NewCallForExam ? Txt_Created_new_call_for_exam :
|
||||||
Txt_The_call_for_exam_has_been_successfully_updated);
|
Txt_The_call_for_exam_has_been_successfully_updated);
|
||||||
Frm_FreeAnchorStr (Anchor);
|
Frm_FreeAnchorStr (Anchor);
|
||||||
|
|
||||||
/***** Set exam to be highlighted *****/
|
/***** Set exam to be highlighted *****/
|
||||||
|
|
|
@ -606,10 +606,11 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate
|
||||||
|
|
||||||
TODO: Attach pdf files in multimedia.
|
TODO: Attach pdf files in multimedia.
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 21.104.1 (2022-07-13)"
|
#define Log_PLATFORM_VERSION "SWAD 21.105 (2022-07-14)"
|
||||||
#define CSS_FILE "swad21.103.6.css"
|
#define CSS_FILE "swad21.103.6.css"
|
||||||
#define JS_FILE "swad21.100.js"
|
#define JS_FILE "swad21.100.js"
|
||||||
/*
|
/*
|
||||||
|
Version 21.105: Jul 14, 2022 Removing resource from program item. (328617 lines)
|
||||||
Version 21.104.1: Jul 13, 2022 Adding resources to program items. (328504 lines)
|
Version 21.104.1: Jul 13, 2022 Adding resources to program items. (328504 lines)
|
||||||
Version 21.104: Jul 12, 2022 Adding resources to program items. (328263 lines)
|
Version 21.104: Jul 12, 2022 Adding resources to program items. (328263 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
|
|
|
@ -546,11 +546,7 @@ static void Prg_WriteRowWithItemForm (Prg_CreateOrChangeItem_t CreateOrChangeIte
|
||||||
|
|
||||||
/* List of item resources */
|
/* List of item resources */
|
||||||
if (CreateOrChangeItem == Prg_PUT_FORM_CHANGE_ITEM)
|
if (CreateOrChangeItem == Prg_PUT_FORM_CHANGE_ITEM)
|
||||||
{
|
PrgRsc_EditResources (ItmCod);
|
||||||
HTM_ARTICLE_Begin ("rsc_form");
|
|
||||||
PrgRsc_EditResources (ItmCod);
|
|
||||||
HTM_ARTICLE_End ();
|
|
||||||
}
|
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** End row *****/
|
/***** End row *****/
|
||||||
|
@ -1706,7 +1702,7 @@ static void Prg_ShowFormToChangeItem (long ItmCod)
|
||||||
Prg_DB_GetItemTxt (Item.Hierarchy.ItmCod,Txt);
|
Prg_DB_GetItemTxt (Item.Hierarchy.ItmCod,Txt);
|
||||||
|
|
||||||
/***** Show pending alerts */
|
/***** Show pending alerts */
|
||||||
Ale_ShowAlerts (NULL);
|
// Ale_ShowAlerts (NULL);
|
||||||
|
|
||||||
/***** Begin form *****/
|
/***** Begin form *****/
|
||||||
Frm_BeginFormAnchor (ActChgPrgItm,"prg_highlighted");
|
Frm_BeginFormAnchor (ActChgPrgItm,"prg_highlighted");
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "swad_error.h"
|
#include "swad_error.h"
|
||||||
#include "swad_global.h"
|
#include "swad_global.h"
|
||||||
#include "swad_program.h"
|
#include "swad_program.h"
|
||||||
|
#include "swad_program_resource.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************** External global variables from others modules ****************/
|
/************** External global variables from others modules ****************/
|
||||||
|
@ -486,3 +487,17 @@ void Prg_DB_RemoveCrsItems (long CrsCod)
|
||||||
" WHERE CrsCod=%ld",
|
" WHERE CrsCod=%ld",
|
||||||
CrsCod);
|
CrsCod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************************** Remove an item resource **************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Prg_DB_RemoveResource (const struct PrgRsc_Resource *Resource)
|
||||||
|
{
|
||||||
|
DB_QueryDELETE ("can not remove item resource",
|
||||||
|
"DELETE FROM prg_resources"
|
||||||
|
" WHERE RscCod=%ld"
|
||||||
|
" AND ItmCod=%ld", // Extra check
|
||||||
|
Resource->RscCod,
|
||||||
|
Resource->ItmCod);
|
||||||
|
}
|
||||||
|
|
|
@ -29,11 +29,13 @@
|
||||||
|
|
||||||
#include "swad_hierarchy_level.h"
|
#include "swad_hierarchy_level.h"
|
||||||
#include "swad_program.h"
|
#include "swad_program.h"
|
||||||
|
#include "swad_program_resource.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************************** Public prototypes *****************************/
|
/***************************** Public prototypes *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
//--------------------------------- Items -------------------------------------
|
||||||
long Prg_DB_InsertItem (const struct Prg_Item *Item,const char *Txt);
|
long Prg_DB_InsertItem (const struct Prg_Item *Item,const char *Txt);
|
||||||
void Prg_DB_UpdateItem (const struct Prg_Item *Item,const char *Txt);
|
void Prg_DB_UpdateItem (const struct Prg_Item *Item,const char *Txt);
|
||||||
void Prg_DB_HideOrUnhideItem (long ItmCod,bool Hide);
|
void Prg_DB_HideOrUnhideItem (long ItmCod,bool Hide);
|
||||||
|
@ -57,4 +59,7 @@ unsigned Prg_DB_GetNumItems (HieLvl_Level_t Scope);
|
||||||
void Prg_DB_RemoveItemRange (const struct Prg_ItemRange *ToRemove);
|
void Prg_DB_RemoveItemRange (const struct Prg_ItemRange *ToRemove);
|
||||||
void Prg_DB_RemoveCrsItems (long CrsCod);
|
void Prg_DB_RemoveCrsItems (long CrsCod);
|
||||||
|
|
||||||
|
//------------------------------ Resources ------------------------------------
|
||||||
|
void Prg_DB_RemoveResource (const struct PrgRsc_Resource *Resource);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -109,6 +109,11 @@ static struct
|
||||||
.Levels = NULL
|
.Levels = NULL
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static long PrgSrc_RscCodToBeRemoved = -1L;
|
||||||
|
|
||||||
|
static const char *PrgRsc_RESOURCE_SECTION_ID = "rsc_section";
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************************** Private prototypes ****************************/
|
/***************************** Private prototypes ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -185,6 +190,7 @@ void PrgRsc_ShowResources (long ItmCod)
|
||||||
void PrgRsc_EditResources (long ItmCod)
|
void PrgRsc_EditResources (long ItmCod)
|
||||||
{
|
{
|
||||||
extern const char *Hlp_COURSE_Program;
|
extern const char *Hlp_COURSE_Program;
|
||||||
|
extern const char *Txt_Remove_resource;
|
||||||
extern const char *Txt_Resources;
|
extern const char *Txt_Resources;
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
unsigned NumRsc;
|
unsigned NumRsc;
|
||||||
|
@ -198,44 +204,64 @@ void PrgRsc_EditResources (long ItmCod)
|
||||||
/***** Get list of item resources from database *****/
|
/***** Get list of item resources from database *****/
|
||||||
NumResources = Prg_DB_GetListResources (&mysql_res,ItmCod); // Resources found...
|
NumResources = Prg_DB_GetListResources (&mysql_res,ItmCod); // Resources found...
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin section *****/
|
||||||
Box_BoxBegin ("100%",Txt_Resources,
|
HTM_SECTION_Begin (PrgRsc_RESOURCE_SECTION_ID);
|
||||||
PrgRsc_PutIconsListResources,&ItmCod,
|
|
||||||
Hlp_COURSE_Program,Box_NOT_CLOSABLE);
|
|
||||||
|
|
||||||
/***** Table *****/
|
/***** Show possible alerts *****/
|
||||||
HTM_TABLE_BeginWideMarginPadding (2);
|
switch (Gbl.Action.Act)
|
||||||
HTM_TBODY_Begin (NULL); // 1st tbody start
|
{
|
||||||
|
case ActReqRemPrgRsc:
|
||||||
|
/* Alert with button to remove resource */
|
||||||
|
Ale_ShowLastAlertAndButton (ActRemPrgRsc,PrgRsc_RESOURCE_SECTION_ID,NULL,
|
||||||
|
PrgRsc_PutParams,&PrgSrc_RscCodToBeRemoved,
|
||||||
|
Btn_REMOVE_BUTTON,Txt_Remove_resource);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Ale_ShowAlerts (PrgRsc_RESOURCE_SECTION_ID);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/***** Write all item resources *****/
|
/***** Begin box *****/
|
||||||
for (NumRsc = 1;
|
Box_BoxBegin ("100%",Txt_Resources,
|
||||||
NumRsc <= NumResources;
|
PrgRsc_PutIconsListResources,&ItmCod,
|
||||||
NumRsc++)
|
Hlp_COURSE_Program,Box_NOT_CLOSABLE);
|
||||||
{
|
|
||||||
/* Get data of this item resource */
|
|
||||||
PrgRsc_GetDataOfResource (&Resource,&mysql_res);
|
|
||||||
|
|
||||||
/* Show item */
|
/***** Table *****/
|
||||||
PrgRsc_WriteRowEditResource (NumRsc,&Resource);
|
HTM_TABLE_BeginWideMarginPadding (2);
|
||||||
|
HTM_TBODY_Begin (NULL);
|
||||||
|
|
||||||
The_ChangeRowColor ();
|
/***** Write all item resources *****/
|
||||||
}
|
for (NumRsc = 1;
|
||||||
|
NumRsc <= NumResources;
|
||||||
|
NumRsc++)
|
||||||
|
{
|
||||||
|
/* Get data of this item resource */
|
||||||
|
PrgRsc_GetDataOfResource (&Resource,&mysql_res);
|
||||||
|
|
||||||
/***** Create item at the end? *****/
|
/* Show item */
|
||||||
/*
|
PrgRsc_WriteRowEditResource (NumRsc,&Resource);
|
||||||
if (ItmCodBeforeForm <= 0 && CreateOrChangeItem == Prg_PUT_FORM_CREATE_ITEM)
|
|
||||||
Prg_WriteRowWithItemForm (Prg_PUT_FORM_CREATE_ITEM,-1L,1);
|
|
||||||
*/
|
|
||||||
|
|
||||||
/***** End table *****/
|
The_ChangeRowColor ();
|
||||||
HTM_TBODY_End (); // 3rd tbody end
|
}
|
||||||
HTM_TABLE_End ();
|
|
||||||
|
|
||||||
/***** Button to create a new program item *****/
|
/***** Create item at the end? *****/
|
||||||
PrgRsc_PutButtonToCreateNewResource (ItmCod);
|
/*
|
||||||
|
if (ItmCodBeforeForm <= 0 && CreateOrChangeItem == Prg_PUT_FORM_CREATE_ITEM)
|
||||||
|
Prg_WriteRowWithItemForm (Prg_PUT_FORM_CREATE_ITEM,-1L,1);
|
||||||
|
*/
|
||||||
|
|
||||||
/***** End box *****/
|
/***** End table *****/
|
||||||
Box_BoxEnd ();
|
HTM_TBODY_End ();
|
||||||
|
HTM_TABLE_End ();
|
||||||
|
|
||||||
|
/***** Button to create a new program item *****/
|
||||||
|
PrgRsc_PutButtonToCreateNewResource (ItmCod);
|
||||||
|
|
||||||
|
/***** End box *****/
|
||||||
|
Box_BoxEnd ();
|
||||||
|
|
||||||
|
/***** End section *****/
|
||||||
|
HTM_SECTION_End ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -257,7 +283,7 @@ static void PrgRsc_PutIconsListResources (void *ItmCod)
|
||||||
|
|
||||||
static void PrgSrc_PutIconToCreateNewResource (long ItmCod)
|
static void PrgSrc_PutIconToCreateNewResource (long ItmCod)
|
||||||
{
|
{
|
||||||
Ico_PutContextualIconToAdd (ActFrmNewPrgRsc,"rsc_form",
|
Ico_PutContextualIconToAdd (ActFrmNewPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
|
||||||
Prg_PutParams,&ItmCod);
|
Prg_PutParams,&ItmCod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,7 +295,7 @@ static void PrgRsc_PutButtonToCreateNewResource (long ItmCod)
|
||||||
{
|
{
|
||||||
extern const char *Txt_New_resource;
|
extern const char *Txt_New_resource;
|
||||||
|
|
||||||
Frm_BeginFormAnchor (ActFrmNewPrgRsc,"rsc_form");
|
Frm_BeginFormAnchor (ActFrmNewPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
|
||||||
Prg_PutParams (&ItmCod);
|
Prg_PutParams (&ItmCod);
|
||||||
Btn_PutConfirmButton (Txt_New_resource);
|
Btn_PutConfirmButton (Txt_New_resource);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
@ -441,7 +467,7 @@ static void PrgRsc_PutFormsToRemEditOneResource (struct PrgRsc_Resource *Resourc
|
||||||
case Rol_TCH:
|
case Rol_TCH:
|
||||||
case Rol_SYS_ADM:
|
case Rol_SYS_ADM:
|
||||||
/***** Put form to remove program item *****/
|
/***** Put form to remove program item *****/
|
||||||
Ico_PutContextualIconToRemove (ActReqRemPrgRsc,"rsc_form",
|
Ico_PutContextualIconToRemove (ActReqRemPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
|
||||||
PrgRsc_PutParams,&Resource->RscCod);
|
PrgRsc_PutParams,&Resource->RscCod);
|
||||||
|
|
||||||
/***** Put form to hide/show program item *****/
|
/***** Put form to hide/show program item *****/
|
||||||
|
@ -522,7 +548,6 @@ static long PrgRsc_GetParamRscCod (void)
|
||||||
void PrgRsc_ReqRemResource (void)
|
void PrgRsc_ReqRemResource (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Do_you_really_want_to_remove_the_resource_X;
|
extern const char *Txt_Do_you_really_want_to_remove_the_resource_X;
|
||||||
extern const char *Txt_Remove_resource;
|
|
||||||
struct PrgRsc_Resource Resource;
|
struct PrgRsc_Resource Resource;
|
||||||
long ItmCodBeforeForm;
|
long ItmCodBeforeForm;
|
||||||
unsigned FormLevel;
|
unsigned FormLevel;
|
||||||
|
@ -537,12 +562,52 @@ void PrgRsc_ReqRemResource (void)
|
||||||
if (Resource.ItmCod <= 0)
|
if (Resource.ItmCod <= 0)
|
||||||
Err_WrongResourceExit ();
|
Err_WrongResourceExit ();
|
||||||
|
|
||||||
/***** Show question and button to remove the item resource *****/
|
/***** Create alert to remove the item resource *****/
|
||||||
Ale_ShowAlertAndButton (ActRemPrgItm,NULL,NULL,
|
Ale_CreateAlert (Ale_QUESTION,PrgRsc_RESOURCE_SECTION_ID,
|
||||||
PrgRsc_PutParams,&Resource.RscCod,
|
Txt_Do_you_really_want_to_remove_the_resource_X,
|
||||||
Btn_REMOVE_BUTTON,Txt_Remove_resource,
|
Resource.Title);
|
||||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_resource_X,
|
PrgSrc_RscCodToBeRemoved = Resource.RscCod;
|
||||||
Resource.Title);
|
|
||||||
|
/***** Get the code of the program item *****/
|
||||||
|
ItmCodBeforeForm = Resource.ItmCod;
|
||||||
|
FormLevel = Prg_GetLevelFromNumItem (Prg_GetNumItemFromItmCod (Resource.ItmCod));
|
||||||
|
|
||||||
|
/***** Show current program items, if any *****/
|
||||||
|
Prg_SetItemRangeEmpty (&ToHighlight);
|
||||||
|
Prg_ShowAllItems (Prg_PUT_FORM_CHANGE_ITEM,
|
||||||
|
&ToHighlight,-1L,ItmCodBeforeForm,FormLevel);
|
||||||
|
|
||||||
|
/***** Free list of program items *****/
|
||||||
|
Prg_FreeListItems ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/**************************** Remove an item resource ************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void PrgRsc_RemoveResource (void)
|
||||||
|
{
|
||||||
|
extern const char *Txt_Resource_X_removed;
|
||||||
|
struct PrgRsc_Resource Resource;
|
||||||
|
long ItmCodBeforeForm;
|
||||||
|
unsigned FormLevel;
|
||||||
|
struct Prg_ItemRange ToHighlight;
|
||||||
|
|
||||||
|
/***** Get list of program items *****/
|
||||||
|
Prg_GetListItems ();
|
||||||
|
|
||||||
|
/***** Get data of the item resource from database *****/
|
||||||
|
Resource.RscCod = PrgRsc_GetParamRscCod ();
|
||||||
|
PrgRsc_GetDataOfResourceByCod (&Resource);
|
||||||
|
if (Resource.ItmCod <= 0)
|
||||||
|
Err_WrongResourceExit ();
|
||||||
|
|
||||||
|
/***** Remove resource *****/
|
||||||
|
Prg_DB_RemoveResource (&Resource);
|
||||||
|
|
||||||
|
/***** Create alert to remove the item resource *****/
|
||||||
|
Ale_CreateAlert (Ale_SUCCESS,PrgRsc_RESOURCE_SECTION_ID,
|
||||||
|
Txt_Resource_X_removed,Resource.Title);
|
||||||
|
|
||||||
/***** Get the code of the program item *****/
|
/***** Get the code of the program item *****/
|
||||||
ItmCodBeforeForm = Resource.ItmCod;
|
ItmCodBeforeForm = Resource.ItmCod;
|
||||||
|
|
|
@ -56,5 +56,6 @@ void PrgRsc_ShowResources (long ItmCod);
|
||||||
void PrgRsc_EditResources (long ItmCod);
|
void PrgRsc_EditResources (long ItmCod);
|
||||||
void PrgRsc_RequestCreateResource (void);
|
void PrgRsc_RequestCreateResource (void);
|
||||||
void PrgRsc_ReqRemResource (void);
|
void PrgRsc_ReqRemResource (void);
|
||||||
|
void PrgRsc_RemoveResource (void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
23
swad_text.c
23
swad_text.c
|
@ -35648,6 +35648,29 @@ const char *Txt_Reset_survey =
|
||||||
"Reset survey"; // Çeviri lazim!
|
"Reset survey"; // Çeviri lazim!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char *Txt_Resource_X_removed = // Warning: it is very important to include %s in the following sentences
|
||||||
|
#if L==1 // ca
|
||||||
|
"Recurs <strong>%s</strong> eliminat.";
|
||||||
|
#elif L==2 // de
|
||||||
|
"Ressource <strong>%s</strong> entfernt.";
|
||||||
|
#elif L==3 // en
|
||||||
|
"Resource <strong>s</strong> removed.";
|
||||||
|
#elif L==4 // es
|
||||||
|
"Recurso <strong>%s</strong> eliminado.";
|
||||||
|
#elif L==5 // fr
|
||||||
|
"Ressource <strong>%s</strong> supprimée.";
|
||||||
|
#elif L==6 // gn
|
||||||
|
"Recurso <strong>%s</strong> eliminado."; // Okoteve traducción
|
||||||
|
#elif L==7 // it
|
||||||
|
"Risorsa <strong>%s</strong> rimossa.";
|
||||||
|
#elif L==8 // pl
|
||||||
|
"Usunięto zasób <strong>%s</strong>.";
|
||||||
|
#elif L==9 // pt
|
||||||
|
"Recurso <strong>%s</strong> removido.";
|
||||||
|
#elif L==10 // tr
|
||||||
|
"Kaynak <strong>s</strong> kaldırıldı.";
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *Txt_Resources =
|
const char *Txt_Resources =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Recursos";
|
"Recursos";
|
||||||
|
|
|
@ -5741,6 +5741,29 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
||||||
"Request removal of resource" // Precisa de tradução
|
"Request removal of resource" // Precisa de tradução
|
||||||
#elif L==10 // tr
|
#elif L==10 // tr
|
||||||
"Request removal of resource" // Çeviri lazim!
|
"Request removal of resource" // Çeviri lazim!
|
||||||
|
#endif
|
||||||
|
,
|
||||||
|
[ActRemPrgRsc] =
|
||||||
|
#if L==1 // ca
|
||||||
|
"Remove resource" // Necessita traducció
|
||||||
|
#elif L==2 // de
|
||||||
|
"Remove resource" // Need Übersetzung
|
||||||
|
#elif L==3 // en
|
||||||
|
"Remove resource"
|
||||||
|
#elif L==4 // es
|
||||||
|
"Eliminar recurso"
|
||||||
|
#elif L==5 // fr
|
||||||
|
"Remove resource" // Besoin de traduction
|
||||||
|
#elif L==6 // gn
|
||||||
|
"Eliminar recurso" // Okoteve traducción
|
||||||
|
#elif L==7 // it
|
||||||
|
"Remove resource" // Bisogno di traduzione
|
||||||
|
#elif L==8 // pl
|
||||||
|
"Remove resource" // Potrzebujesz tlumaczenie
|
||||||
|
#elif L==9 // pt
|
||||||
|
"Remove resource" // Precisa de tradução
|
||||||
|
#elif L==10 // tr
|
||||||
|
"Remove resource" // Çeviri lazim!
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[ActSeeTchGui] =
|
[ActSeeTchGui] =
|
||||||
|
|
Loading…
Reference in New Issue