diff --git a/swad_action.c b/swad_action.c index fd2ebdd8..8276b090 100644 --- a/swad_action.c +++ b/swad_action.c @@ -1711,7 +1711,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActRecDegLog */{ 553,-1,TabUnk,ActSeeDegInf , 0, 0,0x1E0, 0, 0, 0, 0,Act_CONT_DATA,Act_THIS_WINDOW,Deg_ReceiveLogo ,Deg_ShowConfiguration ,NULL}, /* ActRemDegLog */{1343,-1,TabUnk,ActSeeDegInf , 0, 0,0x1E0, 0, 0, 0, 0,Act_CONT_DATA,Act_THIS_WINDOW,Deg_RemoveLogo ,Deg_ShowConfiguration ,NULL}, - /* ActEdiCrs */{ 555,-1,TabUnk,ActSeeCrs , 0, 0,0x1FE, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Crs_ReqEditCourses ,NULL}, + /* ActEdiCrs */{ 555,-1,TabUnk,ActSeeCrs , 0, 0,0x1FE, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Crs_EditCourses ,NULL}, /* ActReqCrs */{1053,-1,TabUnk,ActSeeCrs , 0, 0,0x1FE, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,Crs_RecFormReqCrs ,Crs_ContEditAfterChgCrs ,NULL}, /* ActNewCrs */{ 556,-1,TabUnk,ActSeeCrs , 0, 0,0x1E0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,Crs_RecFormNewCrs ,Crs_ContEditAfterChgCrs ,NULL}, /* ActRemCrs */{ 560,-1,TabUnk,ActSeeCrs , 0, 0,0x1FE, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Crs_RemoveCourse ,NULL}, diff --git a/swad_changelog.h b/swad_changelog.h index df2319cb..98200ccc 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -223,14 +223,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.196.2 (2017-04-30)" +#define Log_PLATFORM_VERSION "SWAD 16.196.3 (2017-04-30)" #define CSS_FILE "swad16.195.8.css" #define JS_FILE "swad16.181.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1 /* - Version 16.196.2: Apr 30, 2017 Changes in layout of edition of centres. (218537 lines) + Version 16.196.3: Apr 30, 2017 Changes in layout of edition of courses. (218540 lines) + Version 16.196.2: Apr 30, 2017 Changes in layout of edition of degrees. (218537 lines) Version 16.196.1: Apr 30, 2017 Changes in layout of edition of centres. (218538 lines) Version 16.196: Apr 30, 2017 Changes in layout of edition of institutions. (218525 lines) Version 16.195.8: Apr 29, 2017 Changes in layout of file browser. (218511 lines) diff --git a/swad_course.c b/swad_course.c index 29be5d71..20769ccf 100644 --- a/swad_course.c +++ b/swad_course.c @@ -83,7 +83,7 @@ static void Crs_PutIconsListCourses (void); static void Crs_PutIconToEditCourses (void); static bool Crs_ListCoursesOfAYearForSeeing (unsigned Year); -static void Crs_EditCourses (void); +static void Crs_PutIconToViewCourses (void); static void Crs_ListCoursesForEdition (void); static void Crs_ListCoursesOfAYearForEdition (unsigned Year); static bool Crs_CheckIfICanEdit (struct Course *Crs); @@ -960,31 +960,6 @@ void Crs_ShowCrssOfCurrentDeg (void) } } -/*****************************************************************************/ -/************************ Request edition of courses *************************/ -/*****************************************************************************/ - -void Crs_ReqEditCourses (void) - { - if (Gbl.CurrentDeg.Deg.DegCod > 0) - { - /***** Get list of courses in this degree *****/ - Crs_GetListCoursesInDegree (Crs_ALL_COURSES_EXCEPT_REMOVED); - - /***** Get list of degrees in this centre *****/ - Deg_GetListDegsOfCurrentCtr (); - - /***** Put form to edit courses *****/ - Crs_EditCourses (); - - /***** Free list of courses in this degree *****/ - Crs_FreeListCoursesInDegree (&Gbl.CurrentDeg.Deg); - - /***** Free list of degrees in this centre *****/ - Deg_FreeListDegs (&Gbl.CurrentCtr.Ctr.Degs); - } - } - /*****************************************************************************/ /*************** Create a list with courses in current degree ****************/ /*****************************************************************************/ @@ -1343,14 +1318,52 @@ static bool Crs_ListCoursesOfAYearForSeeing (unsigned Year) /****************** Put forms to edit courses in this degree *****************/ /*****************************************************************************/ -static void Crs_EditCourses (void) +void Crs_EditCourses (void) { + extern const char *Hlp_DEGREE_Courses; + extern const char *Txt_Courses_of_DEGREE_X; + + /***** Get list of courses in this degree *****/ + Crs_GetListCoursesInDegree (Crs_ALL_COURSES_EXCEPT_REMOVED); + + /***** Get list of degrees in this centre *****/ + Deg_GetListDegsOfCurrentCtr (); + + /***** Start frame *****/ + sprintf (Gbl.Message,Txt_Courses_of_DEGREE_X,Gbl.CurrentDeg.Deg.ShrtName); + Lay_StartRoundFrame (NULL,Gbl.Message,Crs_PutIconToViewCourses, + Hlp_DEGREE_Courses); + /***** Put a form to create or request a new course *****/ Crs_PutFormToCreateCourse (); /***** Forms to edit current courses *****/ if (Gbl.CurrentDeg.NumCrss) Crs_ListCoursesForEdition (); + + /***** End frame *****/ + Lay_EndRoundFrame (); + + /***** Free list of courses in this degree *****/ + Crs_FreeListCoursesInDegree (&Gbl.CurrentDeg.Deg); + + /***** Free list of degrees in this centre *****/ + Deg_FreeListDegs (&Gbl.CurrentCtr.Ctr.Degs); + } + +/*****************************************************************************/ +/**************** Put contextual icons in edition of courses *****************/ +/*****************************************************************************/ + +static void Crs_PutIconToViewCourses (void) + { + extern const char *Txt_View; + + /***** Put form to view courses *****/ + Lay_PutContextualLink (ActSeeCrs,NULL,NULL, + "eye-on64x64.png", + Txt_View,NULL, + NULL); } /*****************************************************************************/ @@ -1359,14 +1372,10 @@ static void Crs_EditCourses (void) static void Crs_ListCoursesForEdition (void) { - extern const char *Hlp_DEGREE_Courses; - extern const char *Txt_Courses_of_DEGREE_X; unsigned Year; /***** Write heading *****/ - sprintf (Gbl.Message,Txt_Courses_of_DEGREE_X, - Gbl.CurrentDeg.Deg.ShrtName); - Lay_StartRoundFrameTable (NULL,Gbl.Message,NULL,Hlp_DEGREE_Courses,2); + fprintf (Gbl.F.Out,"