Version 15.155.4

This commit is contained in:
Antonio Cañas Vargas 2016-03-20 12:35:27 +01:00
parent bf5ac1b324
commit 17cee29b97
2 changed files with 45 additions and 48 deletions

View File

@ -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)

View File

@ -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,"<table class=\"FRAME_TABLE CELLS_PAD_2\""
" style=\"margin-bottom:20px;\">");
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,"</table>");
}
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,"<table class=\"FRAME_TABLE CELLS_PAD_2\">");
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,"</table>");
/***** 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 **********************/
/*****************************************************************************/