From 429136495ff9273230826b6e3c215c2482d097a5 Mon Sep 17 00:00:00 2001 From: acanas Date: Fri, 23 Sep 2022 01:33:33 +0200 Subject: [PATCH] Version 22.22: Sep 23, 2022 Course program open to teachers and students. --- swad_action.c | 6 +++--- swad_assignment.c | 3 ++- swad_attendance.c | 3 ++- swad_browser.c | 11 ++--------- swad_call_for_exam.c | 3 ++- swad_changelog.h | 3 ++- swad_course.c | 2 +- swad_exam.c | 3 ++- swad_forum.c | 3 ++- swad_game.c | 3 ++- swad_survey.c | 3 ++- 11 files changed, 22 insertions(+), 21 deletions(-) diff --git a/swad_action.c b/swad_action.c index dfec807d4..c7094a7b8 100644 --- a/swad_action.c +++ b/swad_action.c @@ -412,7 +412,7 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = // TabCrs ****************************************************************** // Actions in menu: [ActSeeCrsInf ] = { 847, 0,TabCrs,ActSeeCrsInf ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Crs_ShowIntroduction ,"info" }, - [ActSeePrg ] = {1821, 1,TabCrs,ActSeePrg ,0x200,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ShowCourseProgram ,"clipboard-list" }, + [ActSeePrg ] = {1821, 1,TabCrs,ActSeePrg ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ShowCourseProgram ,"clipboard-list" }, [ActSeeTchGui ] = { 784, 2,TabCrs,ActSeeTchGui ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_ShowInfo ,"book-open" }, [ActSeeSyl ] = {1242, 3,TabCrs,ActSeeSyl ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_ShowInfo ,"list-ol" }, [ActSeeBib ] = { 32, 4,TabCrs,ActSeeBib ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_ShowInfo ,"book" }, @@ -443,9 +443,9 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = [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}, [ActRgtPrgItm ] = {1833,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_MoveRightItem ,NULL}, - [ActExpSeePrgItm ] = {1944,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ExpandItem ,NULL}, + [ActExpSeePrgItm ] = {1944,-1,TabUnk,ActSeePrg ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ExpandItem ,NULL}, [ActExpEdiPrgItm ] = {1946,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ExpandItem ,NULL}, - [ActConSeePrgItm ] = {1945,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ContractItem ,NULL}, + [ActConSeePrgItm ] = {1945,-1,TabUnk,ActSeePrg ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ContractItem ,NULL}, [ActConEdiPrgItm ] = {1947,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ContractItem ,NULL}, [ActFrmSeePrgRsc ] = {1925,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,PrgRsc_ViewResourcesAfterEdit ,NULL}, diff --git a/swad_assignment.c b/swad_assignment.c index a27d1f4e2..9e3c46027 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -439,7 +439,8 @@ void Asg_ShowOneAssignmentInBox (struct Asg_Assignments *Assignments) static void Asg_PutIconsOneAsg (void *Assignments) { /***** Put icon to get resource link *****/ - if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // Only if I am superuser // TODO: Include teachers + if (Gbl.Usrs.Me.Role.Logged == Rol_TCH || // Only if I am a teacher + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // or a superuser Ico_PutContextualIconToGetLink (ActReqLnkAsg,NULL, Asg_PutParams,Assignments); } diff --git a/swad_attendance.c b/swad_attendance.c index 4be8b3920..815ab6417 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -1517,7 +1517,8 @@ static void Att_ShowEvent (struct Att_Events *Events) static void Att_PutIconsOneAtt (void *Events) { /***** Put icon to get resource link *****/ - if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // Only if I am superuser // TODO: Include teachers + if (Gbl.Usrs.Me.Role.Logged == Rol_TCH || // Only if I am a teacher + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // or a superuser Ico_PutContextualIconToGetLink (ActReqLnkAtt,NULL, Att_PutParams,Events); } diff --git a/swad_browser.c b/swad_browser.c index 83253c3ff..c44018d64 100644 --- a/swad_browser.c +++ b/swad_browser.c @@ -8145,21 +8145,14 @@ void Brw_ShowFileMetadata (void) FileNameToShow); /***** Begin box *****/ - /* - PutIconToGetLink = (Gbl.FileBrowser.Type == Brw_SHOW_DOC_CRS || // Only document zone - Gbl.FileBrowser.Type == Brw_ADMI_DOC_CRS) && - (FileMetadata.FilFolLnk.Type == Brw_IS_FILE || // Only files or links - FileMetadata.FilFolLnk.Type == Brw_IS_LINK) && - (Gbl.Usrs.Me.Role.Logged == Rol_TCH || // Only if I am teacher or superuser - Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); - */ PutIconToGetLink = (Gbl.FileBrowser.Type == Brw_SHOW_DOC_CRS || // Only document zone Gbl.FileBrowser.Type == Brw_ADMI_DOC_CRS || Gbl.FileBrowser.Type == Brw_SHOW_MRK_CRS || Gbl.FileBrowser.Type == Brw_ADMI_MRK_CRS) && (FileMetadata.FilFolLnk.Type == Brw_IS_FILE || // Only files or links FileMetadata.FilFolLnk.Type == Brw_IS_LINK) && - (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); // Only if I am superuser // TODO: Include teachers + (Gbl.Usrs.Me.Role.Logged == Rol_TCH || // Only if I am a teacher + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); // or a superuser if (PutIconToGetLink) Box_BoxShadowBegin (NULL,NULL, Brw_PutIconToGetLinkToFile,&FileMetadata, diff --git a/swad_call_for_exam.c b/swad_call_for_exam.c index 8b4be6626..3d6f1788f 100644 --- a/swad_call_for_exam.c +++ b/swad_call_for_exam.c @@ -1538,7 +1538,8 @@ static void Cfe_PutIconsCallForExam (void *CallsForExams) &((struct Cfe_CallsForExams *) CallsForExams)->ExaCod); /***** Link to get resource link *****/ - if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // Only if I am superuser // TODO: Include teachers + if (Gbl.Usrs.Me.Role.Logged == Rol_TCH || // Only if I am a teacher + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // or a superuser Ico_PutContextualIconToGetLink (ActReqLnkCfe,NULL, Cfe_PutParamExaCodToEdit, &((struct Cfe_CallsForExams *) CallsForExams)->ExaCod); diff --git a/swad_changelog.h b/swad_changelog.h index 30c058a6f..ba18bb387 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -606,10 +606,11 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate TODO: Attach pdf files in multimedia. */ -#define Log_PLATFORM_VERSION "SWAD 22.21 (2022-09-22)" +#define Log_PLATFORM_VERSION "SWAD 22.22 (2022-09-23)" #define CSS_FILE "swad22.21.css" #define JS_FILE "swad21.100.js" /* + Version 22.22: Sep 23, 2022 Course program open to teachers and students. (331856 lines) Version 22.21: Sep 22, 2022 Changes in layout of course program. (331855 lines) Version 22.20: Sep 22, 2022 Hidden items are not shown in program. (331838 lines) Copy the following icon to icon public directory: diff --git a/swad_course.c b/swad_course.c index 7135545b6..f22e7f759 100644 --- a/swad_course.c +++ b/swad_course.c @@ -768,7 +768,7 @@ void Crs_WriteSelectorMyCoursesInBreadcrumb (void) Enr_GetMyCourses (); /***** Begin form *****/ - Frm_BeginFormGoTo (Gbl.Usrs.Me.MyCrss.Num ? ActSeeCrsInf : + Frm_BeginFormGoTo (Gbl.Usrs.Me.MyCrss.Num ? ActSeePrg : ActReqSch); /***** Begin selector of courses *****/ diff --git a/swad_exam.c b/swad_exam.c index 096e4111c..814310301 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -660,7 +660,8 @@ static void Exa_PutIconToShowResultsOfExam (void *Exams) /***** Link to get resource link *****/ - if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // Only if I am superuser // TODO: Include teachers + if (Gbl.Usrs.Me.Role.Logged == Rol_TCH || // Only if I am a teacher + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // or a superuser Ico_PutContextualIconToGetLink (ActReqLnkExa,NULL, Exa_PutParams,Exams); } diff --git a/swad_forum.c b/swad_forum.c index 9f70e95a2..30ee45542 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -843,7 +843,8 @@ static void For_PutIconsOneThread (void *Forums) /***** Put icon to get resource link *****/ if (((struct For_Forums *) Forums)->Forum.Type == For_FORUM_COURSE_USRS && - Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // Only if I am superuser // TODO: Include teachers + (Gbl.Usrs.Me.Role.Logged == Rol_TCH || // Only if I am a teacher + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)) // or a superuser Ico_PutContextualIconToGetLink (ActReqLnkForCrsUsr,NULL, For_PutAllHiddenParamsNewPost,Forums); } diff --git a/swad_game.c b/swad_game.c index 4d67007b0..abdff85eb 100644 --- a/swad_game.c +++ b/swad_game.c @@ -710,7 +710,8 @@ static void Gam_PutIconsOneGame (void *Games) Gam_PutParams,Games); /***** Link to get resource link *****/ - if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // Only if I am superuser // TODO: Include teachers + if (Gbl.Usrs.Me.Role.Logged == Rol_TCH || // Only if I am a teacher + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // or a superuser Ico_PutContextualIconToGetLink (ActReqLnkGam,NULL, Gam_PutParams,Games); } diff --git a/swad_survey.c b/swad_survey.c index a8411f033..461ea7a6f 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -731,7 +731,8 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys, static void Svy_PutIconsOneSvy (void *Surveys) { /***** Put icon to get resource link *****/ - if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // Only if I am superuser // TODO: Include teachers + if (Gbl.Usrs.Me.Role.Logged == Rol_TCH || // Only if I am a teacher + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // or a superuser Ico_PutContextualIconToGetLink (ActReqLnkSvy,NULL, Svy_PutParams,Surveys); }