From 17cee29b97f357149f0cf207e8cbc2ab12694305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sun, 20 Mar 2016 12:35:27 +0100 Subject: [PATCH] Version 15.155.4 --- swad_changelog.h | 3 +- swad_course.c | 90 +++++++++++++++++++++++------------------------- 2 files changed, 45 insertions(+), 48 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 8982b6007..cda37a1ce 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -134,13 +134,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.155.3 (2016-03-20)" +#define Log_PLATFORM_VERSION "SWAD 15.155.4 (2016-03-20)" #define CSS_FILE "swad15.152.css" #define JS_FILE "swad15.131.3.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 15.155.4: Mar 20, 2016 Changes in layout of listing of courses. (196059 lines) Version 15.155.3: Mar 20, 2016 Changes in some help messages. (196062 lines) Version 15.155.2: Mar 20, 2016 Fixed bug in surveys. Changes in edition of questions of surveys. (196060 lines) diff --git a/swad_course.c b/swad_course.c index 0543834c5..a4900b2ef 100644 --- a/swad_course.c +++ b/swad_course.c @@ -80,10 +80,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void); static void Crs_GetListCoursesInDegree (Crs_WhatCourses_t WhatCourses); static void Crs_ListCourses (void); -static void Crs_EditCourses (void); -static void Crs_ListCoursesForSeeing (bool ICanEdit); static void Crs_PutIconToEditCourses (void); static bool Crs_ListCoursesOfAYearForSeeing (unsigned Year); + +static void Crs_EditCourses (void); static void Crs_ListCoursesForEdition (void); static bool Crs_CheckIfICanEdit (struct Course *Crs); static Crs_StatusTxt_t Crs_GetStatusTxtFromStatusBits (Crs_Status_t Status); @@ -1116,16 +1116,40 @@ void Crs_WriteSelectorMyCourses (void) static void Crs_ListCourses (void) { + extern const char *Txt_Courses_of_DEGREE_X; extern const char *Txt_No_courses_have_been_created_in_this_degree; extern const char *Txt_Create_another_course; extern const char *Txt_Create_course; + unsigned Year; bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_); + /***** Start frame *****/ + sprintf (Gbl.Title,Txt_Courses_of_DEGREE_X,Gbl.CurrentDeg.Deg.ShortName); + Lay_StartRoundFrame (NULL,Gbl.Title,ICanEdit ? Crs_PutIconToEditCourses : + NULL); + if (Gbl.CurrentDeg.Deg.NumCrss) // There are courses in the current degree - Crs_ListCoursesForSeeing (ICanEdit); - else // No courses created in the current degree + { + /***** Start table *****/ + fprintf (Gbl.F.Out,""); + Crs_PutHeadCoursesForSeeing (); + + /***** List the courses *****/ + for (Year = 1; + Year <= Deg_MAX_YEARS_PER_DEGREE; + Year++) + if (Crs_ListCoursesOfAYearForSeeing (Year)) // If this year has courses ==> + Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; // ==> change color for the next year + Crs_ListCoursesOfAYearForSeeing (0); // Courses without a year selected + + /***** End table *****/ + fprintf (Gbl.F.Out,"
"); + } + else // No courses created in the current degree Lay_ShowAlert (Lay_INFO,Txt_No_courses_have_been_created_in_this_degree); + /***** Button to create course *****/ if (ICanEdit) { Act_FormStart (ActEdiCrs); @@ -1133,50 +1157,8 @@ static void Crs_ListCourses (void) Txt_Create_course); Act_FormEnd (); } - } -/*****************************************************************************/ -/****************** Put forms to edit courses in this degree *****************/ -/*****************************************************************************/ - -static void Crs_EditCourses (void) - { - /***** Put a form to create or request a new course *****/ - Crs_PutFormToCreateCourse (); - - /***** Forms to edit current courses *****/ - if (Gbl.CurrentDeg.Deg.NumCrss) - Crs_ListCoursesForEdition (); - } - -/*****************************************************************************/ -/********************** List current courses for seeing **********************/ -/*****************************************************************************/ - -static void Crs_ListCoursesForSeeing (bool ICanEdit) - { - extern const char *Txt_Courses_of_DEGREE_X; - unsigned Year; - - /***** Write heading *****/ - sprintf (Gbl.Title,Txt_Courses_of_DEGREE_X, - Gbl.CurrentDeg.Deg.ShortName); - Lay_StartRoundFrame (NULL,Gbl.Title, - ICanEdit ? Crs_PutIconToEditCourses : - NULL); - fprintf (Gbl.F.Out,""); - Crs_PutHeadCoursesForSeeing (); - - /***** List the courses *****/ - for (Year = 1; - Year <= Deg_MAX_YEARS_PER_DEGREE; - Year++) - if (Crs_ListCoursesOfAYearForSeeing (Year)) // If this year has courses ==> - Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; // ==> change color for the next year - Crs_ListCoursesOfAYearForSeeing (0); // Courses without a year selected - - /***** Table end *****/ - fprintf (Gbl.F.Out,"
"); + /***** End frame *****/ Lay_EndRoundFrame (); } @@ -1300,6 +1282,20 @@ static bool Crs_ListCoursesOfAYearForSeeing (unsigned Year) return ThisYearHasCourses; } +/*****************************************************************************/ +/****************** Put forms to edit courses in this degree *****************/ +/*****************************************************************************/ + +static void Crs_EditCourses (void) + { + /***** Put a form to create or request a new course *****/ + Crs_PutFormToCreateCourse (); + + /***** Forms to edit current courses *****/ + if (Gbl.CurrentDeg.Deg.NumCrss) + Crs_ListCoursesForEdition (); + } + /*****************************************************************************/ /********************* List current courses for edition **********************/ /*****************************************************************************/