Version 21.106: Jul 14, 2022 Hide/unhide resource from program item.

This commit is contained in:
acanas 2022-07-14 14:34:17 +02:00
parent a87d0d26d4
commit e45bf73e21
9 changed files with 363 additions and 138 deletions

View File

@ -436,7 +436,7 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
[ActReqRemPrgItm ] = {1827,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ReqRemItem ,NULL}, [ActReqRemPrgItm ] = {1827,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ReqRemItem ,NULL},
[ActRemPrgItm ] = {1828,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RemoveItem ,NULL}, [ActRemPrgItm ] = {1828,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RemoveItem ,NULL},
[ActHidPrgItm ] = {1829,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_HideItem ,NULL}, [ActHidPrgItm ] = {1829,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_HideItem ,NULL},
[ActShoPrgItm ] = {1830,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_UnhideItem ,NULL}, [ActUnhPrgItm ] = {1830,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_UnhideItem ,NULL},
[ActUp_PrgItm ] = {1831,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_MoveUpItem ,NULL}, [ActUp_PrgItm ] = {1831,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_MoveUpItem ,NULL},
[ActDwnPrgItm ] = {1832,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_MoveDownItem ,NULL}, [ActDwnPrgItm ] = {1832,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_MoveDownItem ,NULL},
[ActLftPrgItm ] = {1834,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_MoveLeftItem ,NULL}, [ActLftPrgItm ] = {1834,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_MoveLeftItem ,NULL},
@ -445,6 +445,10 @@ 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}, [ActRemPrgRsc ] = {1920,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,PrgRsc_RemoveResource ,NULL},
[ActHidPrgRsc ] = {1921,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,PrgRsc_HideResource ,NULL},
[ActUnhPrgRsc ] = {1922,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,PrgRsc_UnhideResource ,NULL},
[ActUp_PrgRsc ] = {1923,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,PrgRsc_MoveUpResource ,NULL},
[ActDwnPrgRsc ] = {1924,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,PrgRsc_MoveDownResource ,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},
@ -3660,7 +3664,7 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
ActReqRemPrgItm, // #1827 ActReqRemPrgItm, // #1827
ActRemPrgItm, // #1828 ActRemPrgItm, // #1828
ActHidPrgItm, // #1829 ActHidPrgItm, // #1829
ActShoPrgItm, // #1830 ActUnhPrgItm, // #1830
ActUp_PrgItm, // #1832 ActUp_PrgItm, // #1832
ActDwnPrgItm, // #1833 ActDwnPrgItm, // #1833
ActRgtPrgItm, // #1833 ActRgtPrgItm, // #1833
@ -3751,6 +3755,10 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
ActFrmNewPrgRsc, // #1918 ActFrmNewPrgRsc, // #1918
ActReqRemPrgRsc, // #1919 ActReqRemPrgRsc, // #1919
ActRemPrgRsc, // #1920 ActRemPrgRsc, // #1920
ActHidPrgRsc, // #1921
ActUnhPrgRsc, // #1922
ActUp_PrgRsc, // #1923
ActDwnPrgRsc, // #1924
}; };
/*****************************************************************************/ /*****************************************************************************/

View File

@ -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 1920 #define Act_MAX_ACTION_COD 1924
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13 #define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13
@ -403,7 +403,7 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
#define ActReqRemPrgItm (ActChgCrsSta + 20) #define ActReqRemPrgItm (ActChgCrsSta + 20)
#define ActRemPrgItm (ActChgCrsSta + 21) #define ActRemPrgItm (ActChgCrsSta + 21)
#define ActHidPrgItm (ActChgCrsSta + 22) #define ActHidPrgItm (ActChgCrsSta + 22)
#define ActShoPrgItm (ActChgCrsSta + 23) #define ActUnhPrgItm (ActChgCrsSta + 23)
#define ActUp_PrgItm (ActChgCrsSta + 24) #define ActUp_PrgItm (ActChgCrsSta + 24)
#define ActDwnPrgItm (ActChgCrsSta + 25) #define ActDwnPrgItm (ActChgCrsSta + 25)
#define ActLftPrgItm (ActChgCrsSta + 26) #define ActLftPrgItm (ActChgCrsSta + 26)
@ -411,107 +411,111 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
#define ActFrmNewPrgRsc (ActChgCrsSta + 28) #define ActFrmNewPrgRsc (ActChgCrsSta + 28)
#define ActReqRemPrgRsc (ActChgCrsSta + 29) #define ActReqRemPrgRsc (ActChgCrsSta + 29)
#define ActRemPrgRsc (ActChgCrsSta + 30) #define ActRemPrgRsc (ActChgCrsSta + 30)
#define ActEdiTchGui (ActChgCrsSta + 31) #define ActHidPrgRsc (ActChgCrsSta + 31)
#define ActSeeSylLec (ActChgCrsSta + 32) #define ActUnhPrgRsc (ActChgCrsSta + 32)
#define ActSeeSylPra (ActChgCrsSta + 33) #define ActUp_PrgRsc (ActChgCrsSta + 33)
#define ActEdiSylLec (ActChgCrsSta + 34) #define ActDwnPrgRsc (ActChgCrsSta + 34)
#define ActEdiSylPra (ActChgCrsSta + 35) #define ActEdiTchGui (ActChgCrsSta + 35)
#define ActDelItmSylLec (ActChgCrsSta + 36) #define ActSeeSylLec (ActChgCrsSta + 36)
#define ActDelItmSylPra (ActChgCrsSta + 37) #define ActSeeSylPra (ActChgCrsSta + 37)
#define ActUp_IteSylLec (ActChgCrsSta + 38) #define ActEdiSylLec (ActChgCrsSta + 38)
#define ActUp_IteSylPra (ActChgCrsSta + 39) #define ActEdiSylPra (ActChgCrsSta + 39)
#define ActDwnIteSylLec (ActChgCrsSta + 40) #define ActDelItmSylLec (ActChgCrsSta + 40)
#define ActDwnIteSylPra (ActChgCrsSta + 41) #define ActDelItmSylPra (ActChgCrsSta + 41)
#define ActRgtIteSylLec (ActChgCrsSta + 42) #define ActUp_IteSylLec (ActChgCrsSta + 42)
#define ActRgtIteSylPra (ActChgCrsSta + 43) #define ActUp_IteSylPra (ActChgCrsSta + 43)
#define ActLftIteSylLec (ActChgCrsSta + 44) #define ActDwnIteSylLec (ActChgCrsSta + 44)
#define ActLftIteSylPra (ActChgCrsSta + 45) #define ActDwnIteSylPra (ActChgCrsSta + 45)
#define ActInsIteSylLec (ActChgCrsSta + 46) #define ActRgtIteSylLec (ActChgCrsSta + 46)
#define ActInsIteSylPra (ActChgCrsSta + 47) #define ActRgtIteSylPra (ActChgCrsSta + 47)
#define ActModIteSylLec (ActChgCrsSta + 48) #define ActLftIteSylLec (ActChgCrsSta + 48)
#define ActModIteSylPra (ActChgCrsSta + 49) #define ActLftIteSylPra (ActChgCrsSta + 49)
#define ActInsIteSylLec (ActChgCrsSta + 50)
#define ActInsIteSylPra (ActChgCrsSta + 51)
#define ActModIteSylLec (ActChgCrsSta + 52)
#define ActModIteSylPra (ActChgCrsSta + 53)
#define ActEdiBib (ActChgCrsSta + 50) #define ActEdiBib (ActChgCrsSta + 54)
#define ActEdiFAQ (ActChgCrsSta + 51) #define ActEdiFAQ (ActChgCrsSta + 55)
#define ActEdiCrsLnk (ActChgCrsSta + 52) #define ActEdiCrsLnk (ActChgCrsSta + 56)
#define ActChgFrcReaCrsInf (ActChgCrsSta + 53) #define ActChgFrcReaCrsInf (ActChgCrsSta + 57)
#define ActChgFrcReaTchGui (ActChgCrsSta + 54) #define ActChgFrcReaTchGui (ActChgCrsSta + 58)
#define ActChgFrcReaSylLec (ActChgCrsSta + 55) #define ActChgFrcReaSylLec (ActChgCrsSta + 59)
#define ActChgFrcReaSylPra (ActChgCrsSta + 56) #define ActChgFrcReaSylPra (ActChgCrsSta + 60)
#define ActChgFrcReaBib (ActChgCrsSta + 57) #define ActChgFrcReaBib (ActChgCrsSta + 61)
#define ActChgFrcReaFAQ (ActChgCrsSta + 58) #define ActChgFrcReaFAQ (ActChgCrsSta + 62)
#define ActChgFrcReaCrsLnk (ActChgCrsSta + 59) #define ActChgFrcReaCrsLnk (ActChgCrsSta + 63)
#define ActChgHavReaCrsInf (ActChgCrsSta + 60) #define ActChgHavReaCrsInf (ActChgCrsSta + 64)
#define ActChgHavReaTchGui (ActChgCrsSta + 61) #define ActChgHavReaTchGui (ActChgCrsSta + 65)
#define ActChgHavReaSylLec (ActChgCrsSta + 62) #define ActChgHavReaSylLec (ActChgCrsSta + 66)
#define ActChgHavReaSylPra (ActChgCrsSta + 63) #define ActChgHavReaSylPra (ActChgCrsSta + 67)
#define ActChgHavReaBib (ActChgCrsSta + 64) #define ActChgHavReaBib (ActChgCrsSta + 68)
#define ActChgHavReaFAQ (ActChgCrsSta + 65) #define ActChgHavReaFAQ (ActChgCrsSta + 69)
#define ActChgHavReaCrsLnk (ActChgCrsSta + 66) #define ActChgHavReaCrsLnk (ActChgCrsSta + 70)
#define ActSelInfSrcCrsInf (ActChgCrsSta + 67) #define ActSelInfSrcCrsInf (ActChgCrsSta + 71)
#define ActSelInfSrcTchGui (ActChgCrsSta + 68) #define ActSelInfSrcTchGui (ActChgCrsSta + 72)
#define ActSelInfSrcSylLec (ActChgCrsSta + 69) #define ActSelInfSrcSylLec (ActChgCrsSta + 73)
#define ActSelInfSrcSylPra (ActChgCrsSta + 70) #define ActSelInfSrcSylPra (ActChgCrsSta + 74)
#define ActSelInfSrcBib (ActChgCrsSta + 71) #define ActSelInfSrcBib (ActChgCrsSta + 75)
#define ActSelInfSrcFAQ (ActChgCrsSta + 72) #define ActSelInfSrcFAQ (ActChgCrsSta + 76)
#define ActSelInfSrcCrsLnk (ActChgCrsSta + 73) #define ActSelInfSrcCrsLnk (ActChgCrsSta + 77)
#define ActRcvURLCrsInf (ActChgCrsSta + 74) #define ActRcvURLCrsInf (ActChgCrsSta + 78)
#define ActRcvURLTchGui (ActChgCrsSta + 75) #define ActRcvURLTchGui (ActChgCrsSta + 79)
#define ActRcvURLSylLec (ActChgCrsSta + 76) #define ActRcvURLSylLec (ActChgCrsSta + 80)
#define ActRcvURLSylPra (ActChgCrsSta + 77) #define ActRcvURLSylPra (ActChgCrsSta + 81)
#define ActRcvURLBib (ActChgCrsSta + 78) #define ActRcvURLBib (ActChgCrsSta + 82)
#define ActRcvURLFAQ (ActChgCrsSta + 79) #define ActRcvURLFAQ (ActChgCrsSta + 83)
#define ActRcvURLCrsLnk (ActChgCrsSta + 80) #define ActRcvURLCrsLnk (ActChgCrsSta + 84)
#define ActRcvPagCrsInf (ActChgCrsSta + 81) #define ActRcvPagCrsInf (ActChgCrsSta + 85)
#define ActRcvPagTchGui (ActChgCrsSta + 82) #define ActRcvPagTchGui (ActChgCrsSta + 86)
#define ActRcvPagSylLec (ActChgCrsSta + 83) #define ActRcvPagSylLec (ActChgCrsSta + 87)
#define ActRcvPagSylPra (ActChgCrsSta + 84) #define ActRcvPagSylPra (ActChgCrsSta + 88)
#define ActRcvPagBib (ActChgCrsSta + 85) #define ActRcvPagBib (ActChgCrsSta + 89)
#define ActRcvPagFAQ (ActChgCrsSta + 86) #define ActRcvPagFAQ (ActChgCrsSta + 90)
#define ActRcvPagCrsLnk (ActChgCrsSta + 87) #define ActRcvPagCrsLnk (ActChgCrsSta + 91)
#define ActEditorCrsInf (ActChgCrsSta + 88) #define ActEditorCrsInf (ActChgCrsSta + 92)
#define ActEditorTchGui (ActChgCrsSta + 89) #define ActEditorTchGui (ActChgCrsSta + 93)
#define ActEditorSylLec (ActChgCrsSta + 90) #define ActEditorSylLec (ActChgCrsSta + 94)
#define ActEditorSylPra (ActChgCrsSta + 91) #define ActEditorSylPra (ActChgCrsSta + 95)
#define ActEditorBib (ActChgCrsSta + 92) #define ActEditorBib (ActChgCrsSta + 96)
#define ActEditorFAQ (ActChgCrsSta + 93) #define ActEditorFAQ (ActChgCrsSta + 97)
#define ActEditorCrsLnk (ActChgCrsSta + 94) #define ActEditorCrsLnk (ActChgCrsSta + 98)
#define ActPlaTxtEdiCrsInf (ActChgCrsSta + 95) #define ActPlaTxtEdiCrsInf (ActChgCrsSta + 99)
#define ActPlaTxtEdiTchGui (ActChgCrsSta + 96) #define ActPlaTxtEdiTchGui (ActChgCrsSta + 100)
#define ActPlaTxtEdiSylLec (ActChgCrsSta + 97) #define ActPlaTxtEdiSylLec (ActChgCrsSta + 101)
#define ActPlaTxtEdiSylPra (ActChgCrsSta + 98) #define ActPlaTxtEdiSylPra (ActChgCrsSta + 102)
#define ActPlaTxtEdiBib (ActChgCrsSta + 99) #define ActPlaTxtEdiBib (ActChgCrsSta + 103)
#define ActPlaTxtEdiFAQ (ActChgCrsSta + 100) #define ActPlaTxtEdiFAQ (ActChgCrsSta + 104)
#define ActPlaTxtEdiCrsLnk (ActChgCrsSta + 101) #define ActPlaTxtEdiCrsLnk (ActChgCrsSta + 105)
#define ActRchTxtEdiCrsInf (ActChgCrsSta + 102) #define ActRchTxtEdiCrsInf (ActChgCrsSta + 106)
#define ActRchTxtEdiTchGui (ActChgCrsSta + 103) #define ActRchTxtEdiTchGui (ActChgCrsSta + 107)
#define ActRchTxtEdiSylLec (ActChgCrsSta + 104) #define ActRchTxtEdiSylLec (ActChgCrsSta + 108)
#define ActRchTxtEdiSylPra (ActChgCrsSta + 105) #define ActRchTxtEdiSylPra (ActChgCrsSta + 109)
#define ActRchTxtEdiBib (ActChgCrsSta + 106) #define ActRchTxtEdiBib (ActChgCrsSta + 110)
#define ActRchTxtEdiFAQ (ActChgCrsSta + 107) #define ActRchTxtEdiFAQ (ActChgCrsSta + 111)
#define ActRchTxtEdiCrsLnk (ActChgCrsSta + 108) #define ActRchTxtEdiCrsLnk (ActChgCrsSta + 112)
#define ActRcvPlaTxtCrsInf (ActChgCrsSta + 109) #define ActRcvPlaTxtCrsInf (ActChgCrsSta + 113)
#define ActRcvPlaTxtTchGui (ActChgCrsSta + 110) #define ActRcvPlaTxtTchGui (ActChgCrsSta + 114)
#define ActRcvPlaTxtSylLec (ActChgCrsSta + 111) #define ActRcvPlaTxtSylLec (ActChgCrsSta + 115)
#define ActRcvPlaTxtSylPra (ActChgCrsSta + 112) #define ActRcvPlaTxtSylPra (ActChgCrsSta + 116)
#define ActRcvPlaTxtBib (ActChgCrsSta + 113) #define ActRcvPlaTxtBib (ActChgCrsSta + 117)
#define ActRcvPlaTxtFAQ (ActChgCrsSta + 114) #define ActRcvPlaTxtFAQ (ActChgCrsSta + 118)
#define ActRcvPlaTxtCrsLnk (ActChgCrsSta + 115) #define ActRcvPlaTxtCrsLnk (ActChgCrsSta + 119)
#define ActRcvRchTxtCrsInf (ActChgCrsSta + 116) #define ActRcvRchTxtCrsInf (ActChgCrsSta + 120)
#define ActRcvRchTxtTchGui (ActChgCrsSta + 117) #define ActRcvRchTxtTchGui (ActChgCrsSta + 121)
#define ActRcvRchTxtSylLec (ActChgCrsSta + 118) #define ActRcvRchTxtSylLec (ActChgCrsSta + 122)
#define ActRcvRchTxtSylPra (ActChgCrsSta + 119) #define ActRcvRchTxtSylPra (ActChgCrsSta + 123)
#define ActRcvRchTxtBib (ActChgCrsSta + 120) #define ActRcvRchTxtBib (ActChgCrsSta + 124)
#define ActRcvRchTxtFAQ (ActChgCrsSta + 121) #define ActRcvRchTxtFAQ (ActChgCrsSta + 125)
#define ActRcvRchTxtCrsLnk (ActChgCrsSta + 122) #define ActRcvRchTxtCrsLnk (ActChgCrsSta + 126)
#define ActPrnCrsTT (ActChgCrsSta + 123) #define ActPrnCrsTT (ActChgCrsSta + 127)
#define ActEdiCrsTT (ActChgCrsSta + 124) #define ActEdiCrsTT (ActChgCrsSta + 128)
#define ActChgCrsTT (ActChgCrsSta + 125) #define ActChgCrsTT (ActChgCrsSta + 129)
#define ActChgCrsTT1stDay (ActChgCrsSta + 126) #define ActChgCrsTT1stDay (ActChgCrsSta + 130)
/*****************************************************************************/ /*****************************************************************************/
/***************************** Assessment tab ********************************/ /***************************** Assessment tab ********************************/

View File

@ -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.105 (2022-07-14)" #define Log_PLATFORM_VERSION "SWAD 21.106 (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.106: Jul 14, 2022 Hide/unhide resource from program item. (328816 lines)
Version 21.105: Jul 14, 2022 Removing resource from program item. (328617 lines) 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)

View File

@ -751,7 +751,7 @@ static void Prg_PutFormsToRemEditOneItem (unsigned NumItem,
/***** Put form to hide/show program item *****/ /***** Put form to hide/show program item *****/
if (Item->Hierarchy.Hidden) if (Item->Hierarchy.Hidden)
Ico_PutContextualIconToUnhide (ActShoPrgItm,"prg_highlighted", Ico_PutContextualIconToUnhide (ActUnhPrgItm,"prg_highlighted",
Prg_PutParams,&Item->Hierarchy.ItmCod); Prg_PutParams,&Item->Hierarchy.ItmCod);
else else
Ico_PutContextualIconToHide (ActHidPrgItm,"prg_highlighted", Ico_PutContextualIconToHide (ActHidPrgItm,"prg_highlighted",
@ -818,7 +818,7 @@ static bool Prg_CheckIfMoveUpIsAllowed (unsigned NumItem)
return false; return false;
/***** Move up is allowed if the item has brothers before it *****/ /***** Move up is allowed if the item has brothers before it *****/
// NumItem >= 2 // NumItem >= 1
return Prg_GetLevelFromNumItem (NumItem - 1) >= return Prg_GetLevelFromNumItem (NumItem - 1) >=
Prg_GetLevelFromNumItem (NumItem ); Prg_GetLevelFromNumItem (NumItem );
} }

View File

@ -260,8 +260,9 @@ void Prg_DB_GetItemTxt (long ItmCod,char Txt[Cns_MAX_BYTES_TEXT + 1])
/****************** Get list of item resources from database *****************/ /****************** Get list of item resources from database *****************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Prg_DB_GetListResources (MYSQL_RES **mysql_res,long ItmCod) unsigned Prg_DB_GetListResources (MYSQL_RES **mysql_res,long ItmCod,
{ bool ShowHiddenResources)
{/*
static const char *HiddenSubQuery[Rol_NUM_ROLES] = static const char *HiddenSubQuery[Rol_NUM_ROLES] =
{ {
[Rol_UNK ] = " AND Hidden='N'", [Rol_UNK ] = " AND Hidden='N'",
@ -274,6 +275,11 @@ unsigned Prg_DB_GetListResources (MYSQL_RES **mysql_res,long ItmCod)
[Rol_CTR_ADM] = " AND Hidden='N'", [Rol_CTR_ADM] = " AND Hidden='N'",
[Rol_INS_ADM] = " AND Hidden='N'", [Rol_INS_ADM] = " AND Hidden='N'",
[Rol_SYS_ADM] = "", [Rol_SYS_ADM] = "",
}; */
static const char *HiddenSubQuery[2] =
{
[false] = " AND Hidden='N'",
[true ] = "",
}; };
return (unsigned) return (unsigned)
@ -284,10 +290,10 @@ unsigned Prg_DB_GetListResources (MYSQL_RES **mysql_res,long ItmCod)
"Title" // row[3] "Title" // row[3]
" FROM prg_resources" " FROM prg_resources"
" WHERE ItmCod=%ld" " WHERE ItmCod=%ld"
"%s" "%s"
" ORDER BY RscInd", " ORDER BY RscInd",
ItmCod, ItmCod,
HiddenSubQuery[Gbl.Usrs.Me.Role.Logged]); HiddenSubQuery[ShowHiddenResources]);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -501,3 +507,18 @@ void Prg_DB_RemoveResource (const struct PrgRsc_Resource *Resource)
Resource->RscCod, Resource->RscCod,
Resource->ItmCod); Resource->ItmCod);
} }
/*****************************************************************************/
/************************ Hide/unhide an item resource ***********************/
/*****************************************************************************/
void Prg_DB_HideOrUnhideResource (long RscCod,bool Hide)
{
DB_QueryUPDATE ("can not hide/unhide item resource",
"UPDATE prg_resources"
" SET Hidden='%c'"
" WHERE RscCod=%ld",
Hide ? 'Y' :
'N',
RscCod);
}

View File

@ -50,7 +50,8 @@ unsigned Prg_DB_GetListItems (MYSQL_RES **mysql_res);
unsigned Prg_DB_GetDataOfItemByCod (MYSQL_RES **mysql_res,long ItmCod); unsigned Prg_DB_GetDataOfItemByCod (MYSQL_RES **mysql_res,long ItmCod);
void Prg_DB_GetItemTxt (long ItmCod,char Txt[Cns_MAX_BYTES_TEXT + 1]); void Prg_DB_GetItemTxt (long ItmCod,char Txt[Cns_MAX_BYTES_TEXT + 1]);
unsigned Prg_DB_GetListResources (MYSQL_RES **mysql_res,long ItmCod); unsigned Prg_DB_GetListResources (MYSQL_RES **mysql_res,long ItmCod,
bool ShowHiddenResources);
unsigned Prg_DB_GetDataOfResourceByCod (MYSQL_RES **mysql_res,long RscCod); unsigned Prg_DB_GetDataOfResourceByCod (MYSQL_RES **mysql_res,long RscCod);
unsigned Prg_DB_GetNumCoursesWithItems (HieLvl_Level_t Scope); unsigned Prg_DB_GetNumCoursesWithItems (HieLvl_Level_t Scope);
@ -62,4 +63,6 @@ void Prg_DB_RemoveCrsItems (long CrsCod);
//------------------------------ Resources ------------------------------------ //------------------------------ Resources ------------------------------------
void Prg_DB_RemoveResource (const struct PrgRsc_Resource *Resource); void Prg_DB_RemoveResource (const struct PrgRsc_Resource *Resource);
void Prg_DB_HideOrUnhideResource (long RscCod,bool Hide);
#endif #endif

View File

@ -128,13 +128,21 @@ static void PrgRsc_GetDataOfResource (struct PrgRsc_Resource *Resource,
static void PrgRsc_ResetResource (struct PrgRsc_Resource *Resource); static void PrgRsc_ResetResource (struct PrgRsc_Resource *Resource);
static void PrgRsc_WriteRowShowResource (unsigned NumRsc, static void PrgRsc_WriteRowShowResource (unsigned NumRsc,
struct PrgRsc_Resource *Resource); struct PrgRsc_Resource *Resource);
static void PrgRsc_WriteRowEditResource (unsigned NumRsc, static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
struct PrgRsc_Resource *Resource); struct PrgRsc_Resource *Resource);
static void PrgRsc_PutFormsToRemEditOneResource (struct PrgRsc_Resource *Resource); static void PrgRsc_PutFormsToRemEditOneResource (unsigned NumRsc,
unsigned NumResources,
struct PrgRsc_Resource *Resource);
static void PrgRsc_PutParams (void *RscCod); static void PrgRsc_PutParams (void *RscCod);
static void PrgRsc_PutParamRscCod (long RscCod); static void PrgRsc_PutParamRscCod (long RscCod);
static long PrgRsc_GetParamRscCod (void); static long PrgRsc_GetParamRscCod (void);
static void PrgRsc_HideOrUnhideResource (bool Hide);
static bool PrgRsc_CheckIfMoveUpIsAllowed (unsigned NumRsc);
static bool PrgRsc_CheckIfMoveDownIsAllowed (unsigned NumRsc,
unsigned NumResources);
/*****************************************************************************/ /*****************************************************************************/
/****************************** Show resources *******************************/ /****************************** Show resources *******************************/
/*****************************************************************************/ /*****************************************************************************/
@ -151,7 +159,8 @@ void PrgRsc_ShowResources (long ItmCod)
return; return;
/***** Get list of item resources from database *****/ /***** Get list of item resources from database *****/
if ((NumResources = Prg_DB_GetListResources (&mysql_res,ItmCod))) // Resources found... if ((NumResources = Prg_DB_GetListResources (&mysql_res,ItmCod,
false))) // Don't get hidden resources
{ {
/***** Begin box *****/ /***** Begin box *****/
Box_BoxBegin ("100%",NULL, Box_BoxBegin ("100%",NULL,
@ -202,7 +211,8 @@ void PrgRsc_EditResources (long ItmCod)
return; return;
/***** 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,
true); // Get hidden resources
/***** Begin section *****/ /***** Begin section *****/
HTM_SECTION_Begin (PrgRsc_RESOURCE_SECTION_ID); HTM_SECTION_Begin (PrgRsc_RESOURCE_SECTION_ID);
@ -231,15 +241,15 @@ void PrgRsc_EditResources (long ItmCod)
HTM_TBODY_Begin (NULL); HTM_TBODY_Begin (NULL);
/***** Write all item resources *****/ /***** Write all item resources *****/
for (NumRsc = 1; for (NumRsc = 0;
NumRsc <= NumResources; NumRsc < NumResources;
NumRsc++) NumRsc++)
{ {
/* Get data of this item resource */ /* Get data of this item resource */
PrgRsc_GetDataOfResource (&Resource,&mysql_res); PrgRsc_GetDataOfResource (&Resource,&mysql_res);
/* Show item */ /* Show item */
PrgRsc_WriteRowEditResource (NumRsc,&Resource); PrgRsc_WriteRowEditResource (NumRsc,NumResources,&Resource);
The_ChangeRowColor (); The_ChangeRowColor ();
} }
@ -425,7 +435,7 @@ static void PrgRsc_WriteRowShowResource (unsigned NumRsc,
/************************** Edit one item resource ***************************/ /************************** Edit one item resource ***************************/
/*****************************************************************************/ /*****************************************************************************/
static void PrgRsc_WriteRowEditResource (unsigned NumRsc, static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
struct PrgRsc_Resource *Resource) struct PrgRsc_Resource *Resource)
{ {
/***** Begin row *****/ /***** Begin row *****/
@ -433,12 +443,12 @@ static void PrgRsc_WriteRowEditResource (unsigned NumRsc,
/***** Forms to remove/edit this item resource *****/ /***** Forms to remove/edit this item resource *****/
HTM_TD_Begin ("class=\"PRG_COL1 LT %s\"",The_GetColorRows ()); HTM_TD_Begin ("class=\"PRG_COL1 LT %s\"",The_GetColorRows ());
PrgRsc_PutFormsToRemEditOneResource (Resource); PrgRsc_PutFormsToRemEditOneResource (NumRsc,NumResources,Resource);
HTM_TD_End (); HTM_TD_End ();
/***** Resource number *****/ /***** Resource number *****/
HTM_TD_Begin ("class=\"PRG_NUM RT %s\"",The_GetColorRows ()); HTM_TD_Begin ("class=\"PRG_NUM RT %s\"",The_GetColorRows ());
HTM_Unsigned (NumRsc); HTM_Unsigned (NumRsc + 1);
HTM_TD_End (); HTM_TD_End ();
/***** Title *****/ /***** Title *****/
@ -454,7 +464,9 @@ static void PrgRsc_WriteRowEditResource (unsigned NumRsc,
/**************** Put a link (form) to edit one program item *****************/ /**************** Put a link (form) to edit one program item *****************/
/*****************************************************************************/ /*****************************************************************************/
static void PrgRsc_PutFormsToRemEditOneResource (struct PrgRsc_Resource *Resource) static void PrgRsc_PutFormsToRemEditOneResource (unsigned NumRsc,
unsigned NumResources,
struct PrgRsc_Resource *Resource)
{ {
extern const char *Txt_Movement_not_allowed; extern const char *Txt_Movement_not_allowed;
// char StrItemIndex[Cns_MAX_DECIMAL_DIGITS_UINT + 1]; // char StrItemIndex[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
@ -466,17 +478,17 @@ 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 item resource *****/
Ico_PutContextualIconToRemove (ActReqRemPrgRsc,PrgRsc_RESOURCE_SECTION_ID, 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 item resource *****/
//if (Item->Hierarchy.Hidden) if (Resource->Hidden)
// Ico_PutContextualIconToUnhide (ActShoPrgItm,"prg_highlighted", Ico_PutContextualIconToUnhide (ActUnhPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
// Prg_PutParams,&Item->Hierarchy.ItmCod); PrgRsc_PutParams,&Resource->RscCod);
//else else
// Ico_PutContextualIconToHide (ActHidPrgItm,"prg_highlighted", Ico_PutContextualIconToHide (ActHidPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
// Prg_PutParams,&Item->Hierarchy.ItmCod); PrgRsc_PutParams,&Resource->RscCod);
/***** Put form to edit program item *****/ /***** Put form to edit program item *****/
// Ico_PutContextualIconToEdit (ActFrmChgPrgItm,"item_form", // Ico_PutContextualIconToEdit (ActFrmChgPrgItm,"item_form",
@ -489,19 +501,19 @@ static void PrgRsc_PutFormsToRemEditOneResource (struct PrgRsc_Resource *Resourc
HTM_BR (); HTM_BR ();
/***** Put icon to move up the item *****/ /***** Put icon to move up the item *****/
// if (Prg_CheckIfMoveUpIsAllowed (NumItem)) if (PrgRsc_CheckIfMoveUpIsAllowed (NumRsc))
// Lay_PutContextualLinkOnlyIcon (ActUp_PrgItm,"prg_highlighted", Lay_PutContextualLinkOnlyIcon (ActUp_PrgRsc,PrgRsc_RESOURCE_SECTION_ID,
// Prg_PutParams,&Item->Hierarchy.ItmCod, PrgRsc_PutParams,&Resource->RscCod,
// "arrow-up.svg",Ico_BLACK); "arrow-up.svg",Ico_BLACK);
// else else
Ico_PutIconOff ("arrow-up.svg",Ico_BLACK,Txt_Movement_not_allowed); Ico_PutIconOff ("arrow-up.svg",Ico_BLACK,Txt_Movement_not_allowed);
/***** Put icon to move down the item *****/ /***** Put icon to move down the item *****/
// if (Prg_CheckIfMoveDownIsAllowed (NumItem)) if (PrgRsc_CheckIfMoveDownIsAllowed (NumRsc,NumResources))
// Lay_PutContextualLinkOnlyIcon (ActDwnPrgItm,"prg_highlighted", Lay_PutContextualLinkOnlyIcon (ActDwnPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
// Prg_PutParams,&Item->Hierarchy.ItmCod, PrgRsc_PutParams,&Resource->RscCod,
// "arrow-down.svg",Ico_BLACK); "arrow-down.svg",Ico_BLACK);
//else else
Ico_PutIconOff ("arrow-down.svg",Ico_BLACK,Txt_Movement_not_allowed); Ico_PutIconOff ("arrow-down.svg",Ico_BLACK,Txt_Movement_not_allowed);
break; break;
case Rol_STD: case Rol_STD:
@ -621,3 +633,80 @@ void PrgRsc_RemoveResource (void)
/***** Free list of program items *****/ /***** Free list of program items *****/
Prg_FreeListItems (); Prg_FreeListItems ();
} }
/*****************************************************************************/
/***************************** Hide a program item ***************************/
/*****************************************************************************/
void PrgRsc_HideResource (void)
{
PrgRsc_HideOrUnhideResource (true);
}
void PrgRsc_UnhideResource (void)
{
PrgRsc_HideOrUnhideResource (false);
}
static void PrgRsc_HideOrUnhideResource (bool Hide)
{
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 ();
/***** Hide/unhide item resource *****/
Prg_DB_HideOrUnhideResource (Resource.RscCod,Hide);
/***** 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 ();
}
/*****************************************************************************/
/********************* Check if resource can be moved up *********************/
/*****************************************************************************/
static bool PrgRsc_CheckIfMoveUpIsAllowed (unsigned NumRsc)
{
/***** Trivial check: if resource is the first one, move up is not allowed *****/
return (NumRsc != 0);
}
/*****************************************************************************/
/******************** Check if resource can be moved down ********************/
/*****************************************************************************/
static bool PrgRsc_CheckIfMoveDownIsAllowed (unsigned NumRsc,
unsigned NumResources)
{
/***** Trivial check: if resource is the last one, move up is not allowed *****/
return (NumRsc < NumResources - 1);
}
void PrgRsc_MoveUpResource (void)
{
}
void PrgRsc_MoveDownResource (void)
{
}

View File

@ -55,7 +55,14 @@ struct PrgRsc_Resource
void PrgRsc_ShowResources (long ItmCod); 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); void PrgRsc_RemoveResource (void);
void PrgRsc_HideResource (void);
void PrgRsc_UnhideResource (void);
void PrgRsc_MoveUpResource (void);
void PrgRsc_MoveDownResource (void);
#endif #endif

View File

@ -5582,7 +5582,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
"Hide program item" // Çeviri lazim! "Hide program item" // Çeviri lazim!
#endif #endif
, ,
[ActShoPrgItm] = [ActUnhPrgItm] =
#if L==1 // ca #if L==1 // ca
"Show program item" // Necessita traducció "Show program item" // Necessita traducció
#elif L==2 // de #elif L==2 // de
@ -5764,6 +5764,98 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
"Remove resource" // Precisa de tradução "Remove resource" // Precisa de tradução
#elif L==10 // tr #elif L==10 // tr
"Remove resource" // Çeviri lazim! "Remove resource" // Çeviri lazim!
#endif
,
[ActHidPrgRsc] =
#if L==1 // ca
"Hide resource" // Necessita traducció
#elif L==2 // de
"Hide resource" // Need Übersetzung
#elif L==3 // en
"Hide resource"
#elif L==4 // es
"Ocultar recurso"
#elif L==5 // fr
"Hide resource" // Besoin de traduction
#elif L==6 // gn
"Ocultar recurso" // Okoteve traducción
#elif L==7 // it
"Hide resource" // Bisogno di traduzione
#elif L==8 // pl
"Hide resource" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"Hide resource" // Precisa de tradução
#elif L==10 // tr
"Hide resource" // Çeviri lazim!
#endif
,
[ActUnhPrgRsc] =
#if L==1 // ca
"Unhide resource" // Necessita traducció
#elif L==2 // de
"Unhide resource" // Need Übersetzung
#elif L==3 // en
"Unhide resource"
#elif L==4 // es
"Mostrar recurso"
#elif L==5 // fr
"Unhide resource" // Besoin de traduction
#elif L==6 // gn
"Mostrar recurso" // Okoteve traducción
#elif L==7 // it
"Unhide resource" // Bisogno di traduzione
#elif L==8 // pl
"Unhide resource" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"Unhide resource" // Precisa de tradução
#elif L==10 // tr
"Unhide resource" // Çeviri lazim!
#endif
,
[ActUp_PrgRsc] =
#if L==1 // ca
"Move up resource" // Necessita traducció
#elif L==2 // de
"Move up resource" // Need Übersetzung
#elif L==3 // en
"Move up resource"
#elif L==4 // es
"Subir recurso"
#elif L==5 // fr
"Move up resource" // Besoin de traduction
#elif L==6 // gn
"Subir recurso" // Okoteve traducción
#elif L==7 // it
"Move up resource" // Bisogno di traduzione
#elif L==8 // pl
"Move up resource" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"Move up resource" // Precisa de tradução
#elif L==10 // tr
"Move up resource" // Çeviri lazim!
#endif
,
[ActDwnPrgRsc] =
#if L==1 // ca
"Move down resource" // Necessita traducció
#elif L==2 // de
"Move down resource" // Need Übersetzung
#elif L==3 // en
"Move down resource"
#elif L==4 // es
"Bajar recurso"
#elif L==5 // fr
"Move down resource" // Besoin de traduction
#elif L==6 // gn
"Bajar recurso" // Okoteve traducción
#elif L==7 // it
"Move down resource" // Bisogno di traduzione
#elif L==8 // pl
"Move down resource" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"Move down resource" // Precisa de tradução
#elif L==10 // tr
"Move down resource" // Çeviri lazim!
#endif #endif
, ,
[ActSeeTchGui] = [ActSeeTchGui] =