diff --git a/Makefile b/Makefile index c7b72405..c0d5f6ef 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,8 @@ OBJS = swad_account.o swad_action.o swad_agenda.o swad_alert.o \ swad_announcement.o swad_API.o swad_assignment.o swad_attendance.o \ swad_banner.o swad_box.o swad_button.o \ swad_calendar.o swad_centre.o swad_chat.o swad_classroom.o \ - swad_config.o swad_connected.o swad_cookie.o swad_country.o \ - swad_course.o swad_cryptography.o \ + swad_config.o swad_config_course.o swad_connected.o swad_cookie.o \ + swad_country.o swad_course.o swad_cryptography.o \ swad_database.o swad_date.o swad_degree.o swad_degree_type.o \ swad_department.o swad_duplicate.o \ swad_enrolment.o swad_exam.o \ diff --git a/swad_API.c b/swad_API.c index 5c6cc20c..31df8249 100644 --- a/swad_API.c +++ b/swad_API.c @@ -93,10 +93,10 @@ cp -f /home/acanas/swad/swad/swad /var/www/cgi-bin/ #include // For scandir, etc. #include // For PATH_MAX -#include // For NULL -#include // For lstat +#include // For NULL #include #include +#include // For lstat #include "soap/soapH.h" // gSOAP header #include "soap/swad.nsmap" // Namespaces map used diff --git a/swad_RSS.c b/swad_RSS.c index c73d6e26..2181dc00 100644 --- a/swad_RSS.c +++ b/swad_RSS.c @@ -26,7 +26,7 @@ /*****************************************************************************/ #include // For PATH_MAX -#include // For NULL +#include // For NULL #include #include "swad_changelog.h" diff --git a/swad_action.c b/swad_action.c index 5500b897..44872c3b 100644 --- a/swad_action.c +++ b/swad_action.c @@ -25,7 +25,7 @@ /*********************************** Headers *********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include // For fprintf #include // For string functions @@ -1909,12 +1909,12 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = [ActSeeCrsTT ] = { 25, 6,TabCrs,ActSeeCrsTT ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TT_ShowClassTimeTable ,"clock" }, // Actions not in menu: - [ActPrnCrsInf ] = {1028,-1,TabUnk,ActSeeCrsInf ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,Crs_PrintConfiguration ,NULL}, - [ActChgCrsDegCfg ] = {1587,-1,TabUnk,ActSeeCrsInf ,0x380,0x380, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeCrsDegInConfig ,Crs_ContEditAfterChgCrsInConfig,NULL}, - [ActRenCrsShoCfg ] = {1601,-1,TabUnk,ActSeeCrsInf ,0x3C0,0x3C0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_RenameCourseShortInConfig ,Crs_ContEditAfterChgCrsInConfig,NULL}, - [ActRenCrsFulCfg ] = {1600,-1,TabUnk,ActSeeCrsInf ,0x3C0,0x3C0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_RenameCourseFullInConfig ,Crs_ContEditAfterChgCrsInConfig,NULL}, - [ActChgInsCrsCodCfg ] = {1024,-1,TabUnk,ActSeeCrsInf ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeInsCrsCodInConfig ,Crs_ContEditAfterChgCrsInConfig,NULL}, - [ActChgCrsYeaCfg ] = {1573,-1,TabUnk,ActSeeCrsInf ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeCrsYearInConfig ,Crs_ContEditAfterChgCrsInConfig,NULL}, + [ActPrnCrsInf ] = {1028,-1,TabUnk,ActSeeCrsInf ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,CfgCrs_PrintConfiguration ,NULL}, + [ActChgCrsDegCfg ] = {1587,-1,TabUnk,ActSeeCrsInf ,0x380,0x380, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeCrsDegInConfig ,CfgCrs_ContEditAfterChgCrsInConfig,NULL}, + [ActRenCrsShoCfg ] = {1601,-1,TabUnk,ActSeeCrsInf ,0x3C0,0x3C0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_RenameCourseShortInConfig ,CfgCrs_ContEditAfterChgCrsInConfig,NULL}, + [ActRenCrsFulCfg ] = {1600,-1,TabUnk,ActSeeCrsInf ,0x3C0,0x3C0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_RenameCourseFullInConfig ,CfgCrs_ContEditAfterChgCrsInConfig,NULL}, + [ActChgInsCrsCodCfg ] = {1024,-1,TabUnk,ActSeeCrsInf ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeInsCrsCodInConfig ,CfgCrs_ContEditAfterChgCrsInConfig,NULL}, + [ActChgCrsYeaCfg ] = {1573,-1,TabUnk,ActSeeCrsInf ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeCrsYearInConfig ,CfgCrs_ContEditAfterChgCrsInConfig,NULL}, [ActEdiCrsInf ] = { 848,-1,TabUnk,ActSeeCrsInf ,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}, diff --git a/swad_agenda.c b/swad_agenda.c index 795276e0..cece2068 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -27,7 +27,7 @@ #define _GNU_SOURCE // For asprintf #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For asprintf #include // For calloc #include // For string functions diff --git a/swad_alert.c b/swad_alert.c index 8a0c68b7..fd883ca0 100644 --- a/swad_alert.c +++ b/swad_alert.c @@ -26,8 +26,8 @@ /*****************************************************************************/ #define _GNU_SOURCE // For vasprintf -#include // For NULL #include // For va_start, va_end +#include // For NULL #include // For FILE, fprintf, vasprintf #include // For free #include // For string functions diff --git a/swad_assignment.c b/swad_assignment.c index ca724911..f7e29edf 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -27,7 +27,7 @@ #define _GNU_SOURCE // For asprintf #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For asprintf #include // For calloc #include // For string functions diff --git a/swad_attendance.c b/swad_attendance.c index b318d0df..be39784c 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -27,8 +27,8 @@ #define _GNU_SOURCE // For asprintf #include // For PATH_MAX -#include // For NULL #include // To access MySQL databases +#include // For NULL #include // For asprintf #include // For calloc #include // For string functions diff --git a/swad_banner.c b/swad_banner.c index bd308179..c4d2fd75 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -25,7 +25,7 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include // For calloc #include // For string functions diff --git a/swad_centre.c b/swad_centre.c index 59a0d9be..a1435498 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -26,8 +26,8 @@ /*****************************************************************************/ #define _GNU_SOURCE // For asprintf -#include // For NULL #include // For boolean type +#include // For NULL #include // For asprintf #include // For calloc #include // For string functions diff --git a/swad_changelog.h b/swad_changelog.h index 86efb937..6d4ad59c 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -492,7 +492,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.101.5 (2019-12-28)" +#define Log_PLATFORM_VERSION "SWAD 19.102 (2019-12-28)" #define CSS_FILE "swad19.101.5.css" #define JS_FILE "swad19.91.1.js" /* @@ -500,8 +500,9 @@ ps2pdf source.ps destination.pdf // TODO: Impedir la creación y edición de proyectos si no son editables. // TODO: No se puede entrar con DNI '1' suponiendo que no tenga password ¿por qué? - Version 19.103: Dec 28, 2019 Map in country information. (? lines) - Version 19.102: Dec 28, 2019 Map in institution information. (? lines) + Version 19.10x: Dec 28, 2019 Map in country information. (? lines) + Version 19.10x: Dec 28, 2019 Map in institution information. (? lines) + Version 19.102: Dec 29, 2019 New module swad_config_course for course configuration. (249397 lines) Version 19.101.5: Dec 28, 2019 Country information is splitted into two columns. (249330 lines) Version 19.101.4: Dec 28, 2019 Institution information is splitted into two columns. (249324 lines) Version 19.101.3: Dec 28, 2019 Course information is splitted into two columns. (249308 lines) diff --git a/swad_chat.c b/swad_chat.c index e203d372..32abf2fa 100644 --- a/swad_chat.c +++ b/swad_chat.c @@ -25,7 +25,7 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include // For boolean type #include diff --git a/swad_classroom.c b/swad_classroom.c index 32ecd413..a6cdf5f7 100644 --- a/swad_classroom.c +++ b/swad_classroom.c @@ -25,8 +25,8 @@ /********************************** Headers **********************************/ /*****************************************************************************/ -#include // For NULL #include // For calloc, free +#include // For NULL #include // For string functions #include "swad_box.h" diff --git a/swad_config_course.c b/swad_config_course.c new file mode 100644 index 00000000..94b6dfc9 --- /dev/null +++ b/swad_config_course.c @@ -0,0 +1,468 @@ +// swad_config_course.c: configuration of current course + +/* + SWAD (Shared Workspace At a Distance), + is a web platform developed at the University of Granada (Spain), + and used to support university teaching. + + This file is part of SWAD core. + Copyright (C) 1999-2019 Antonio Cañas Vargas + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ +/*****************************************************************************/ +/********************************* Headers ***********************************/ +/*****************************************************************************/ + +#include // For boolean type +#include // For NULL + +#include "swad_form.h" +#include "swad_global.h" +#include "swad_HTML.h" +#include "swad_logo.h" +#include "swad_role.h" + +/*****************************************************************************/ +/************** External global variables from others modules ****************/ +/*****************************************************************************/ + +extern struct Globals Gbl; + +/*****************************************************************************/ +/*************************** Public constants ********************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/***************************** Private types *********************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/**************************** Private variables ******************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/**************************** Private prototypes *****************************/ +/*****************************************************************************/ + +static void CfgCrs_PutIconToPrint (void); +static void CfgCrs_Title (bool PutLink); +static void CfgCrs_Degree (bool PrintView,bool PutForm); +static void CfgCrs_FullName (bool PutForm); +static void CfgCrs_ShrtName (bool PutForm); +static void CfgCrs_Year (bool PutForm); +static void CfgCrs_InstitutionalCode (bool PutForm); +static void CfgCrs_InternalCode (void); +static void CfgCrs_Shortcut (bool PrintView); +static void CfgCrs_QR (void); +static void CfgCrs_NumUsrsInCrs (Rol_Role_t Role); +static void CfgCrs_Indicators (void); + +/*****************************************************************************/ +/***************** Configuration of the current course ***********************/ +/*****************************************************************************/ + +void CfgCrs_Configuration (bool PrintView) + { + extern const char *Hlp_COURSE_Information; + bool PutLink; + bool PutFormDeg; + bool PutFormName; + bool PutFormYear; + bool PutFormInsCod; + + /***** Trivial check *****/ + if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected + return; + + /***** Initializations *****/ + PutLink = !PrintView && Gbl.Hierarchy.Deg.WWW[0]; + PutFormDeg = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM; + PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM; + PutFormYear = + PutFormInsCod = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_TCH; + + /***** Contextual menu *****/ + if (!PrintView) + if (Gbl.Usrs.Me.Role.Logged == Rol_GST || + Gbl.Usrs.Me.Role.Logged == Rol_USR) + { + Mnu_ContextMenuBegin (); + Enr_PutLinkToRequestSignUp (); // Request enrolment in the current course + Mnu_ContextMenuEnd (); + } + + /***** Begin box *****/ + if (PrintView) + Box_BoxBegin (NULL,NULL,NULL, + NULL,Box_NOT_CLOSABLE); + else + Box_BoxBegin (NULL,NULL,CfgCrs_PutIconToPrint, + Hlp_COURSE_Information,Box_NOT_CLOSABLE); + + /***** Title *****/ + CfgCrs_Title (PutLink); + + /**************************** Left part ***********************************/ + HTM_DIV_Begin ("class=\"HIE_CFG_LEFT\""); + + /***** Begin table *****/ + HTM_TABLE_BeginWidePadding (2); + + /***** Degree *****/ + CfgCrs_Degree (PrintView,PutFormDeg); + + /***** Course name *****/ + CfgCrs_FullName (PutFormName); + CfgCrs_ShrtName (PutFormName); + + /***** Course year *****/ + CfgCrs_Year (PutFormYear); + + if (!PrintView) + { + /***** Institutional code of the course *****/ + CfgCrs_InstitutionalCode (PutFormInsCod); + + /***** Internal code of the course *****/ + CfgCrs_InternalCode (); + } + + /***** Shortcut to the couse *****/ + CfgCrs_Shortcut (PrintView); + + if (PrintView) + /***** QR code with link to the course *****/ + CfgCrs_QR (); + else + { + /***** Number of users *****/ + CfgCrs_NumUsrsInCrs (Rol_TCH); + CfgCrs_NumUsrsInCrs (Rol_NET); + CfgCrs_NumUsrsInCrs (Rol_STD); + + /***** Indicators *****/ + CfgCrs_Indicators (); + } + + /***** End table *****/ + HTM_TABLE_End (); + + /***** End of left part *****/ + HTM_DIV_End (); + + /***** End box *****/ + Box_BoxEnd (); + } + +/*****************************************************************************/ +/************* Put icon to print the configuration of a course ***************/ +/*****************************************************************************/ + +static void CfgCrs_PutIconToPrint (void) + { + Ico_PutContextualIconToPrint (ActPrnCrsInf,NULL); + } + +/*****************************************************************************/ +/***************** Print configuration of the current course *****************/ +/*****************************************************************************/ + +void CfgCrs_PrintConfiguration (void) + { + CfgCrs_Configuration (true); + } + +/*****************************************************************************/ +/******************** Show title in course configuration *********************/ +/*****************************************************************************/ + +static void CfgCrs_Title (bool PutLink) + { + Hie_ConfigTitle (PutLink, + Hie_DEG, // Logo scope + Gbl.Hierarchy.Deg.DegCod, // Logo code + Gbl.Hierarchy.Deg.ShrtName, // Logo short name + Gbl.Hierarchy.Deg.FullName, // Logo full name + Gbl.Hierarchy.Deg.WWW, // Logo www + Gbl.Hierarchy.Crs.FullName); // Text full name + } + +/*****************************************************************************/ +/******************** Show degree in course configuration ********************/ +/*****************************************************************************/ + +static void CfgCrs_Degree (bool PrintView,bool PutForm) + { + extern const char *Txt_Degree; + extern const char *Txt_Go_to_X; + unsigned NumDeg; + + /***** Degree *****/ + HTM_TR_Begin (NULL); + + /* Label */ + Frm_LabelColumn ("RT",PutForm ? "OthDegCod" : + NULL, + Txt_Degree); + + /* Data */ + HTM_TD_Begin ("class=\"DAT LB\""); + if (PutForm) + { + /* Get list of degrees of the current centre */ + Deg_GetListDegsOfCurrentCtr (); + + /* Put form to select degree */ + Frm_StartForm (ActChgCrsDegCfg); + HTM_SELECT_Begin (true, + "id=\"OthDegCod\" name=\"OthDegCod\"" + " class=\"INPUT_SHORT_NAME\""); + for (NumDeg = 0; + NumDeg < Gbl.Hierarchy.Ctr.Degs.Num; + NumDeg++) + HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Ctr.Degs.Lst[NumDeg].DegCod, + Gbl.Hierarchy.Ctr.Degs.Lst[NumDeg].DegCod == Gbl.Hierarchy.Deg.DegCod,false, + "%s",Gbl.Hierarchy.Ctr.Degs.Lst[NumDeg].ShrtName); + HTM_SELECT_End (); + Frm_EndForm (); + + /* Free list of degrees of the current centre */ + Deg_FreeListDegs (&Gbl.Hierarchy.Ctr.Degs); + } + else // I can not move course to another degree + { + if (!PrintView) + { + Frm_StartFormGoTo (ActSeeDegInf); + Deg_PutParamDegCod (Gbl.Hierarchy.Deg.DegCod); + snprintf (Gbl.Title,sizeof (Gbl.Title), + Txt_Go_to_X, + Gbl.Hierarchy.Deg.ShrtName); + HTM_BUTTON_SUBMIT_Begin (Gbl.Title,"BT_LINK LT DAT",NULL); + } + Lgo_DrawLogo (Hie_DEG,Gbl.Hierarchy.Deg.DegCod,Gbl.Hierarchy.Deg.ShrtName, + 20,"LM",true); + HTM_NBSP (); + HTM_Txt (Gbl.Hierarchy.Deg.FullName); + if (!PrintView) + { + HTM_BUTTON_End (); + Frm_EndForm (); + } + } + HTM_TD_End (); + + HTM_TR_End (); + } + +/*****************************************************************************/ +/************** Show course full name in course configuration ****************/ +/*****************************************************************************/ + +static void CfgCrs_FullName (bool PutForm) + { + extern const char *Txt_Course; + + Hie_ConfigFullName (PutForm,Txt_Course,ActRenCrsFulCfg, + Gbl.Hierarchy.Crs.FullName); + } + +/*****************************************************************************/ +/************** Show course short name in course configuration ***************/ +/*****************************************************************************/ + +static void CfgCrs_ShrtName (bool PutForm) + { + Hie_ConfigShrtName (PutForm,ActRenCrsShoCfg,Gbl.Hierarchy.Crs.ShrtName); + } + +/*****************************************************************************/ +/***************** Show course year in course configuration ******************/ +/*****************************************************************************/ + +static void CfgCrs_Year (bool PutForm) + { + extern const char *Txt_Year_OF_A_DEGREE; + extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE]; + extern const char *Txt_Not_applicable; + unsigned Year; + + /***** Academic year *****/ + HTM_TR_Begin (NULL); + + /* Label */ + Frm_LabelColumn ("RT",PutForm ? "OthCrsYear" : + NULL, + Txt_Year_OF_A_DEGREE); + + /* Data */ + HTM_TD_Begin ("class=\"DAT LB\""); + if (PutForm) + { + Frm_StartForm (ActChgCrsYeaCfg); + HTM_SELECT_Begin (true, + "id=\"OthCrsYear\" name=\"OthCrsYear\""); + for (Year = 0; + Year <= Deg_MAX_YEARS_PER_DEGREE; + Year++) + HTM_OPTION (HTM_Type_UNSIGNED,&Year, + Year == Gbl.Hierarchy.Crs.Year,false, + "%s",Txt_YEAR_OF_DEGREE[Year]); + HTM_SELECT_End (); + Frm_EndForm (); + } + else + HTM_Txt (Gbl.Hierarchy.Crs.Year ? Txt_YEAR_OF_DEGREE[Gbl.Hierarchy.Crs.Year] : + Txt_Not_applicable); + HTM_TD_End (); + + HTM_TR_End (); + } + +/*****************************************************************************/ +/************* Show institutional code in course configuration ***************/ +/*****************************************************************************/ + +static void CfgCrs_InstitutionalCode (bool PutForm) + { + extern const char *Txt_Institutional_code; + + /***** Institutional course code *****/ + HTM_TR_Begin (NULL); + + /* Label */ + Frm_LabelColumn ("RT",PutForm ? "InsCrsCod" : + NULL, + Txt_Institutional_code); + + /* Data */ + HTM_TD_Begin ("class=\"DAT LB\""); + if (PutForm) + { + Frm_StartForm (ActChgInsCrsCodCfg); + HTM_INPUT_TEXT ("InsCrsCod",Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD, + Gbl.Hierarchy.Crs.InstitutionalCrsCod,true, + "id=\"InsCrsCod\" size=\"%u\" class=\"INPUT_INS_CODE\"", + Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD); + Frm_EndForm (); + } + else + HTM_Txt (Gbl.Hierarchy.Crs.InstitutionalCrsCod); + HTM_TD_End (); + + HTM_TR_End (); + } + +/*****************************************************************************/ +/**************** Show internal code in course configuration *****************/ +/*****************************************************************************/ + +static void CfgCrs_InternalCode (void) + { + extern const char *Txt_Internal_code; + + /***** Internal course code *****/ + HTM_TR_Begin (NULL); + + /* Label */ + Frm_LabelColumn ("RT",NULL,Txt_Internal_code); + + /* Data */ + HTM_TD_Begin ("class=\"DAT LB\""); + HTM_Long (Gbl.Hierarchy.Crs.CrsCod); + HTM_TD_End (); + + HTM_TR_End (); + } + +/*****************************************************************************/ +/*************** Show course shortcut in course configuration ****************/ +/*****************************************************************************/ + +static void CfgCrs_Shortcut (bool PrintView) + { + Hie_ConfigShortcut (PrintView,"crs",Gbl.Hierarchy.Crs.CrsCod); + } + +/*****************************************************************************/ +/****************** Show course QR in course configuration *******************/ +/*****************************************************************************/ + +static void CfgCrs_QR (void) + { + Hie_ConfigQR ("crs",Gbl.Hierarchy.Crs.CrsCod); + } + +/*****************************************************************************/ +/*********************** Number of users in this course **********************/ +/*****************************************************************************/ + +static void CfgCrs_NumUsrsInCrs (Rol_Role_t Role) + { + extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; + + /***** Number of users in course *****/ + HTM_TR_Begin (NULL); + + /* Label */ + Frm_LabelColumn ("RT",NULL,Txt_ROLES_PLURAL_Abc[Role][Usr_SEX_UNKNOWN]); + + /* Data */ + HTM_TD_Begin ("class=\"DAT LB\""); + HTM_Unsigned (Gbl.Hierarchy.Crs.NumUsrs[Role]); + HTM_TD_End (); + + HTM_TR_End (); + } + +/*****************************************************************************/ +/****************** Show indicators in course configuration ******************/ +/*****************************************************************************/ + +static void CfgCrs_Indicators (void) + { + extern const char *Txt_Indicators; + extern const char *Txt_of_PART_OF_A_TOTAL; + struct Ind_IndicatorsCrs Indicators; + int NumIndicatorsFromDB = Ind_GetNumIndicatorsCrsFromDB (Gbl.Hierarchy.Crs.CrsCod); + + /***** Compute indicators ******/ + Ind_ComputeAndStoreIndicatorsCrs (Gbl.Hierarchy.Crs.CrsCod, + NumIndicatorsFromDB,&Indicators); + + /***** Number of indicators *****/ + HTM_TR_Begin (NULL); + + /* Label */ + Frm_LabelColumn ("RT",NULL,Txt_Indicators); + + /* Data */ + HTM_TD_Begin ("class=\"LB\""); + Frm_StartForm (ActReqStaCrs); + snprintf (Gbl.Title,sizeof (Gbl.Title), + "%u %s %u", + Indicators.NumIndicators, + Txt_of_PART_OF_A_TOTAL,Ind_NUM_INDICATORS); + HTM_BUTTON_SUBMIT_Begin (Gbl.Title,"BT_LINK DAT",NULL); + HTM_TxtF ("%s ",Gbl.Title); + Ico_PutIcon ((Indicators.NumIndicators == Ind_NUM_INDICATORS) ? "check-circle.svg" : + "exclamation-triangle.svg", + Gbl.Title,"ICO16x16"); + HTM_BUTTON_End (); + Frm_EndForm (); + HTM_TD_End (); + + HTM_TR_End (); + } diff --git a/swad_config_course.h b/swad_config_course.h new file mode 100644 index 00000000..3324c6e2 --- /dev/null +++ b/swad_config_course.h @@ -0,0 +1,48 @@ +// swad_config_course.h: configuration of current course + +#ifndef _SWAD_CFGCRS +#define _SWAD_CFGCRS +/* + SWAD (Shared Workspace At a Distance in Spanish), + is a web platform developed at the University of Granada (Spain), + and used to support university teaching. + + This file is part of SWAD core. + Copyright (C) 1999-2019 Antonio Cañas Vargas + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ +/*****************************************************************************/ +/********************************* Headers ***********************************/ +/*****************************************************************************/ + +#include // For boolean type + +/*****************************************************************************/ +/***************************** Public constants ******************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/******************************* Public types ********************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/***************************** Public prototypes *****************************/ +/*****************************************************************************/ + +void CfgCrs_Configuration (bool PrintView); +void CfgCrs_PrintConfiguration (void); +void CfgCrs_ContEditAfterChgCrsInConfig (void); + +#endif diff --git a/swad_connected.c b/swad_connected.c index 6c6bdb08..3f56a5c6 100644 --- a/swad_connected.c +++ b/swad_connected.c @@ -27,7 +27,7 @@ #include // For maximum values #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For fprintf #include // For string functions diff --git a/swad_country.c b/swad_country.c index 179f93cf..6a76537c 100644 --- a/swad_country.c +++ b/swad_country.c @@ -26,8 +26,8 @@ /*****************************************************************************/ #define _GNU_SOURCE // For asprintf -#include // For NULL #include // For log10, ceil, pow... +#include // For NULL #include // For asprintf #include // For calloc #include // For string functions diff --git a/swad_course.c b/swad_course.c index ee76c83f..0affb813 100644 --- a/swad_course.c +++ b/swad_course.c @@ -26,33 +26,19 @@ /*****************************************************************************/ #define _GNU_SOURCE // For asprintf -#include // For PATH_MAX -#include // For NULL -#include // For maximum values +#include // For NULL #include // For asprintf -#include // For getenv, etc. #include // For string functions -#include "swad_box.h" +#include "swad_config_course.h" #include "swad_course.h" -#include "swad_constant.h" #include "swad_database.h" -#include "swad_degree.h" -#include "swad_enrolment.h" -#include "swad_exam.h" #include "swad_form.h" #include "swad_global.h" #include "swad_help.h" -#include "swad_hierarchy.h" #include "swad_HTML.h" -#include "swad_indicator.h" +#include "swad_info.h" #include "swad_logo.h" -#include "swad_notification.h" -#include "swad_parameter.h" -#include "swad_role.h" -#include "swad_RSS.h" -#include "swad_tab.h" -#include "swad_theme.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -78,20 +64,6 @@ static struct Course *Crs_EditingCrs = NULL; // Static variable to keep the cour /**************************** Private prototypes *****************************/ /*****************************************************************************/ -static void Crs_Configuration (bool PrintView); -static void Crs_PutIconToPrint (void); -static void Crs_ConfigTitle (bool PutLink); -static void Crs_ConfigDegree (bool PrintView,bool PutForm); -static void Crs_ConfigFullName (bool PutForm); -static void Crs_ConfigShrtName (bool PutForm); -static void Crs_ConfigYear (bool PutForm); -static void Crs_ConfigInstitutionalCode (bool PutForm); -static void Crs_ConfigInternalCode (void); -static void Crs_ConfigShortcut (bool PrintView); -static void Crs_ConfigQR (void); -static void Crs_ShowNumUsrsInCrs (Rol_Role_t Role); -static void Crs_ConfigIndicators (void); - static void Crs_WriteListMyCoursesToSelectOne (void); static void Crs_GetListCoursesInCurrentDegree (Crs_WhatCourses_t WhatCourses); @@ -155,7 +127,7 @@ void Crs_ShowIntroduction (void) { /***** Course configuration *****/ HTM_DIV_Begin ("class=\"CM\""); - Crs_Configuration (false); + CfgCrs_Configuration (false); HTM_DIV_End (); /***** Course introduction *****/ @@ -165,404 +137,6 @@ void Crs_ShowIntroduction (void) Hlp_ShowHelpWhatWouldYouLikeToDo (); } -/*****************************************************************************/ -/***************** Print configuration of the current course *****************/ -/*****************************************************************************/ - -void Crs_PrintConfiguration (void) - { - Crs_Configuration (true); - } - -/*****************************************************************************/ -/***************** Configuration of the current course ***********************/ -/*****************************************************************************/ - -static void Crs_Configuration (bool PrintView) - { - extern const char *Hlp_COURSE_Information; - bool PutLink; - bool PutFormDeg; - bool PutFormName; - bool PutFormYear; - bool PutFormInsCod; - - /***** Trivial check *****/ - if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected - return; - - /***** Initializations *****/ - PutLink = !PrintView && Gbl.Hierarchy.Deg.WWW[0]; - PutFormDeg = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM; - PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM; - PutFormYear = - PutFormInsCod = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_TCH; - - /***** Contextual menu *****/ - if (!PrintView) - if (Gbl.Usrs.Me.Role.Logged == Rol_GST || - Gbl.Usrs.Me.Role.Logged == Rol_USR) - { - Mnu_ContextMenuBegin (); - Enr_PutLinkToRequestSignUp (); // Request enrolment in the current course - Mnu_ContextMenuEnd (); - } - - /***** Begin box *****/ - if (PrintView) - Box_BoxBegin (NULL,NULL,NULL, - NULL,Box_NOT_CLOSABLE); - else - Box_BoxBegin (NULL,NULL,Crs_PutIconToPrint, - Hlp_COURSE_Information,Box_NOT_CLOSABLE); - - /***** Title *****/ - Crs_ConfigTitle (PutLink); - - /**************************** Left part ***********************************/ - HTM_DIV_Begin ("class=\"HIE_CFG_LEFT\""); - - /***** Begin table *****/ - HTM_TABLE_BeginWidePadding (2); - - /***** Degree *****/ - Crs_ConfigDegree (PrintView,PutFormDeg); - - /***** Course name *****/ - Crs_ConfigFullName (PutFormName); - Crs_ConfigShrtName (PutFormName); - - /***** Course year *****/ - Crs_ConfigYear (PutFormYear); - - if (!PrintView) - { - /***** Institutional code of the course *****/ - Crs_ConfigInstitutionalCode (PutFormInsCod); - - /***** Internal code of the course *****/ - Crs_ConfigInternalCode (); - } - - /***** Shortcut to the couse *****/ - Crs_ConfigShortcut (PrintView); - - if (PrintView) - /***** QR code with link to the course *****/ - Crs_ConfigQR (); - else - { - /***** Number of users *****/ - Crs_ShowNumUsrsInCrs (Rol_TCH); - Crs_ShowNumUsrsInCrs (Rol_NET); - Crs_ShowNumUsrsInCrs (Rol_STD); - - /***** Indicators *****/ - Crs_ConfigIndicators (); - } - - /***** End table *****/ - HTM_TABLE_End (); - - /***** End of left part *****/ - HTM_DIV_End (); - - /***** End box *****/ - Box_BoxEnd (); - } - -/*****************************************************************************/ -/************* Put icon to print the configuration of a course ***************/ -/*****************************************************************************/ - -static void Crs_PutIconToPrint (void) - { - Ico_PutContextualIconToPrint (ActPrnCrsInf,NULL); - } - -/*****************************************************************************/ -/******************** Show title in course configuration *********************/ -/*****************************************************************************/ - -static void Crs_ConfigTitle (bool PutLink) - { - Hie_ConfigTitle (PutLink, - Hie_DEG, // Logo scope - Gbl.Hierarchy.Deg.DegCod, // Logo code - Gbl.Hierarchy.Deg.ShrtName, // Logo short name - Gbl.Hierarchy.Deg.FullName, // Logo full name - Gbl.Hierarchy.Deg.WWW, // Logo www - Gbl.Hierarchy.Crs.FullName); // Text full name - } - -/*****************************************************************************/ -/******************** Show degree in course configuration ********************/ -/*****************************************************************************/ - -static void Crs_ConfigDegree (bool PrintView,bool PutForm) - { - extern const char *Txt_Degree; - extern const char *Txt_Go_to_X; - unsigned NumDeg; - - /***** Degree *****/ - HTM_TR_Begin (NULL); - - /* Label */ - Frm_LabelColumn ("RT",PutForm ? "OthDegCod" : - NULL, - Txt_Degree); - - /* Data */ - HTM_TD_Begin ("class=\"DAT LB\""); - if (PutForm) - { - /* Get list of degrees of the current centre */ - Deg_GetListDegsOfCurrentCtr (); - - /* Put form to select degree */ - Frm_StartForm (ActChgCrsDegCfg); - HTM_SELECT_Begin (true, - "id=\"OthDegCod\" name=\"OthDegCod\"" - " class=\"INPUT_SHORT_NAME\""); - for (NumDeg = 0; - NumDeg < Gbl.Hierarchy.Ctr.Degs.Num; - NumDeg++) - HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Ctr.Degs.Lst[NumDeg].DegCod, - Gbl.Hierarchy.Ctr.Degs.Lst[NumDeg].DegCod == Gbl.Hierarchy.Deg.DegCod,false, - "%s",Gbl.Hierarchy.Ctr.Degs.Lst[NumDeg].ShrtName); - HTM_SELECT_End (); - Frm_EndForm (); - - /* Free list of degrees of the current centre */ - Deg_FreeListDegs (&Gbl.Hierarchy.Ctr.Degs); - } - else // I can not move course to another degree - { - if (!PrintView) - { - Frm_StartFormGoTo (ActSeeDegInf); - Deg_PutParamDegCod (Gbl.Hierarchy.Deg.DegCod); - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Go_to_X, - Gbl.Hierarchy.Deg.ShrtName); - HTM_BUTTON_SUBMIT_Begin (Gbl.Title,"BT_LINK LT DAT",NULL); - } - Lgo_DrawLogo (Hie_DEG,Gbl.Hierarchy.Deg.DegCod,Gbl.Hierarchy.Deg.ShrtName, - 20,"LM",true); - HTM_NBSP (); - HTM_Txt (Gbl.Hierarchy.Deg.FullName); - if (!PrintView) - { - HTM_BUTTON_End (); - Frm_EndForm (); - } - } - HTM_TD_End (); - - HTM_TR_End (); - } - -/*****************************************************************************/ -/************** Show course full name in course configuration ****************/ -/*****************************************************************************/ - -static void Crs_ConfigFullName (bool PutForm) - { - extern const char *Txt_Course; - - Hie_ConfigFullName (PutForm,Txt_Course,ActRenCrsFulCfg, - Gbl.Hierarchy.Crs.FullName); - } - -/*****************************************************************************/ -/************** Show course short name in course configuration ***************/ -/*****************************************************************************/ - -static void Crs_ConfigShrtName (bool PutForm) - { - Hie_ConfigShrtName (PutForm,ActRenCrsShoCfg,Gbl.Hierarchy.Crs.ShrtName); - } - -/*****************************************************************************/ -/***************** Show course year in course configuration ******************/ -/*****************************************************************************/ - -static void Crs_ConfigYear (bool PutForm) - { - extern const char *Txt_Year_OF_A_DEGREE; - extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE]; - extern const char *Txt_Not_applicable; - unsigned Year; - - /***** Academic year *****/ - HTM_TR_Begin (NULL); - - /* Label */ - Frm_LabelColumn ("RT",PutForm ? "OthCrsYear" : - NULL, - Txt_Year_OF_A_DEGREE); - - /* Data */ - HTM_TD_Begin ("class=\"DAT LB\""); - if (PutForm) - { - Frm_StartForm (ActChgCrsYeaCfg); - HTM_SELECT_Begin (true, - "id=\"OthCrsYear\" name=\"OthCrsYear\""); - for (Year = 0; - Year <= Deg_MAX_YEARS_PER_DEGREE; - Year++) - HTM_OPTION (HTM_Type_UNSIGNED,&Year, - Year == Gbl.Hierarchy.Crs.Year,false, - "%s",Txt_YEAR_OF_DEGREE[Year]); - HTM_SELECT_End (); - Frm_EndForm (); - } - else - HTM_Txt (Gbl.Hierarchy.Crs.Year ? Txt_YEAR_OF_DEGREE[Gbl.Hierarchy.Crs.Year] : - Txt_Not_applicable); - HTM_TD_End (); - - HTM_TR_End (); - } - -/*****************************************************************************/ -/************* Show institutional code in course configuration ***************/ -/*****************************************************************************/ - -static void Crs_ConfigInstitutionalCode (bool PutForm) - { - extern const char *Txt_Institutional_code; - - /***** Institutional course code *****/ - HTM_TR_Begin (NULL); - - /* Label */ - Frm_LabelColumn ("RT",PutForm ? "InsCrsCod" : - NULL, - Txt_Institutional_code); - - /* Data */ - HTM_TD_Begin ("class=\"DAT LB\""); - if (PutForm) - { - Frm_StartForm (ActChgInsCrsCodCfg); - HTM_INPUT_TEXT ("InsCrsCod",Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD, - Gbl.Hierarchy.Crs.InstitutionalCrsCod,true, - "id=\"InsCrsCod\" size=\"%u\" class=\"INPUT_INS_CODE\"", - Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD); - Frm_EndForm (); - } - else - HTM_Txt (Gbl.Hierarchy.Crs.InstitutionalCrsCod); - HTM_TD_End (); - - HTM_TR_End (); - } - -/*****************************************************************************/ -/**************** Show internal code in course configuration *****************/ -/*****************************************************************************/ - -static void Crs_ConfigInternalCode (void) - { - extern const char *Txt_Internal_code; - - /***** Internal course code *****/ - HTM_TR_Begin (NULL); - - /* Label */ - Frm_LabelColumn ("RT",NULL,Txt_Internal_code); - - /* Data */ - HTM_TD_Begin ("class=\"DAT LB\""); - HTM_Long (Gbl.Hierarchy.Crs.CrsCod); - HTM_TD_End (); - - HTM_TR_End (); - } - -/*****************************************************************************/ -/*************** Show course shortcut in course configuration ****************/ -/*****************************************************************************/ - -static void Crs_ConfigShortcut (bool PrintView) - { - Hie_ConfigShortcut (PrintView,"crs",Gbl.Hierarchy.Crs.CrsCod); - } - -/*****************************************************************************/ -/****************** Show course QR in course configuration *******************/ -/*****************************************************************************/ - -static void Crs_ConfigQR (void) - { - Hie_ConfigQR ("crs",Gbl.Hierarchy.Crs.CrsCod); - } - -/*****************************************************************************/ -/*********************** Number of users in this course **********************/ -/*****************************************************************************/ - -static void Crs_ShowNumUsrsInCrs (Rol_Role_t Role) - { - extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; - - /***** Number of users in course *****/ - HTM_TR_Begin (NULL); - - /* Label */ - Frm_LabelColumn ("RT",NULL,Txt_ROLES_PLURAL_Abc[Role][Usr_SEX_UNKNOWN]); - - /* Data */ - HTM_TD_Begin ("class=\"DAT LB\""); - HTM_Unsigned (Gbl.Hierarchy.Crs.NumUsrs[Role]); - HTM_TD_End (); - - HTM_TR_End (); - } - -/*****************************************************************************/ -/****************** Show indicators in course configuration ******************/ -/*****************************************************************************/ - -static void Crs_ConfigIndicators (void) - { - extern const char *Txt_Indicators; - extern const char *Txt_of_PART_OF_A_TOTAL; - struct Ind_IndicatorsCrs Indicators; - int NumIndicatorsFromDB = Ind_GetNumIndicatorsCrsFromDB (Gbl.Hierarchy.Crs.CrsCod); - - /***** Compute indicators ******/ - Ind_ComputeAndStoreIndicatorsCrs (Gbl.Hierarchy.Crs.CrsCod, - NumIndicatorsFromDB,&Indicators); - - /***** Number of indicators *****/ - HTM_TR_Begin (NULL); - - /* Label */ - Frm_LabelColumn ("RT",NULL,Txt_Indicators); - - /* Data */ - HTM_TD_Begin ("class=\"LB\""); - Frm_StartForm (ActReqStaCrs); - snprintf (Gbl.Title,sizeof (Gbl.Title), - "%u %s %u", - Indicators.NumIndicators, - Txt_of_PART_OF_A_TOTAL,Ind_NUM_INDICATORS); - HTM_BUTTON_SUBMIT_Begin (Gbl.Title,"BT_LINK DAT",NULL); - HTM_TxtF ("%s ",Gbl.Title); - Ico_PutIcon ((Indicators.NumIndicators == Ind_NUM_INDICATORS) ? "check-circle.svg" : - "exclamation-triangle.svg", - Gbl.Title,"ICO16x16"); - HTM_BUTTON_End (); - Frm_EndForm (); - HTM_TD_End (); - - HTM_TR_End (); - } - /*****************************************************************************/ /************************ Write menu with my courses *************************/ /*****************************************************************************/ @@ -2438,7 +2012,7 @@ void Crs_ChangeCrsDegInConfig (void) /** Show message of success after changing a course in course configuration **/ /*****************************************************************************/ -void Crs_ContEditAfterChgCrsInConfig (void) +void CfgCrs_ContEditAfterChgCrsInConfig (void) { /***** Write error/success message *****/ Ale_ShowAlerts (NULL); diff --git a/swad_course.h b/swad_course.h index 57080d0f..fdd32529 100644 --- a/swad_course.h +++ b/swad_course.h @@ -1,4 +1,4 @@ -// swad_course.c: edition of courses +// swad_course.h: edition of courses #ifndef _SWAD_CRS #define _SWAD_CRS @@ -99,8 +99,8 @@ typedef enum /*****************************************************************************/ void Crs_ShowIntroduction (void); -void Crs_PrintConfiguration (void); -void Crs_ContEditAfterChgCrsInConfig (void); +void CfgCrs_PrintConfiguration (void); +void CfgCrs_ContEditAfterChgCrsInConfig (void); unsigned Crs_GetNumCrssTotal (void); unsigned Crs_GetNumCrssInCty (long CtyCod); diff --git a/swad_database.c b/swad_database.c index 216268b7..937de420 100644 --- a/swad_database.c +++ b/swad_database.c @@ -27,9 +27,9 @@ /*****************************************************************************/ #define _GNU_SOURCE // For vasprintf -#include // For NULL #include // To access MySQL databases #include // For va_start, va_end +#include // For NULL #include // For FILE, fprintf, vasprintf #include // For free diff --git a/swad_degree.c b/swad_degree.c index 415baea0..c32dfec1 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -26,8 +26,8 @@ /*****************************************************************************/ #include // For isprint, isspace, etc. -#include // For NULL #include // For boolean type +#include // For NULL #include // For fprintf, etc. #include // For exit, system, calloc, free, etc. #include // For string functions diff --git a/swad_degree_type.c b/swad_degree_type.c index 62168d27..91ce6202 100644 --- a/swad_degree_type.c +++ b/swad_degree_type.c @@ -26,8 +26,8 @@ /*****************************************************************************/ #include // For isprint, isspace, etc. -#include // For NULL #include // For boolean type +#include // For NULL #include // For fprintf, etc. #include // For exit, system, calloc, free, etc. #include // For string functions diff --git a/swad_department.c b/swad_department.c index d9c2caf9..63faf27a 100644 --- a/swad_department.c +++ b/swad_department.c @@ -25,8 +25,8 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ -#include // For NULL #include // For boolean type +#include // For NULL #include // For calloc #include // For string functions diff --git a/swad_exam.c b/swad_exam.c index b200449d..bd33ab67 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -31,7 +31,7 @@ /*****************************************************************************/ #define _GNU_SOURCE // For asprintf -#include // For NULL +#include // For NULL #include // For sscanf, asprintf, etc. #include // For exit, system, malloc, calloc, free, etc. #include // For string functions diff --git a/swad_file.c b/swad_file.c index 1a3d919a..0e3babe0 100644 --- a/swad_file.c +++ b/swad_file.c @@ -29,7 +29,7 @@ #include // For scandir, etc. #include // For errno #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For FILE,fprintf #include // For exit, system, free, etc. #include // For string functions diff --git a/swad_file_browser.c b/swad_file_browser.c index 3a40ad4c..9d66642f 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -29,13 +29,13 @@ #include // For scandir, etc. #include // For errno #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For asprintf #include // For exit, system, free, etc #include // For string functions -#include // For time #include // For lstat, time_t #include // For lstat +#include // For time #include // For access, lstat, getpid, chdir, symlink #include "swad_box.h" diff --git a/swad_forum.c b/swad_forum.c index 5fbd5dd8..0315f7c6 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -26,9 +26,9 @@ /*****************************************************************************/ #define _GNU_SOURCE // For asprintf -#include // For NULL #include // For malloc #include // To access MySQL databases +#include // For NULL #include // For asprintf #include #include // For time_t diff --git a/swad_game.c b/swad_game.c index b384a663..d3de982c 100644 --- a/swad_game.c +++ b/swad_game.c @@ -28,7 +28,7 @@ #define _GNU_SOURCE // For asprintf #include // For DBL_MAX #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For asprintf #include // For calloc #include // For string functions diff --git a/swad_global.c b/swad_global.c index 108705f5..aaabac95 100644 --- a/swad_global.c +++ b/swad_global.c @@ -25,8 +25,8 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ -#include // For NULL #include // For setlocale +#include // For NULL #include // For exit #include // For string functions #include // For gettimeofday diff --git a/swad_group.c b/swad_group.c index 43d4971e..ec0da9f6 100644 --- a/swad_group.c +++ b/swad_group.c @@ -26,7 +26,7 @@ /*****************************************************************************/ #define _GNU_SOURCE // For asprintf -#include // For NULL +#include // For NULL #include // For asprintf #include // For exit, system, malloc, free, rand, etc. #include // For string functions diff --git a/swad_holiday.c b/swad_holiday.c index 102b227f..5c984e21 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -25,7 +25,7 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include // For calloc #include // For string functions diff --git a/swad_indicator.c b/swad_indicator.c index 4c4d3354..23cbf1c6 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -26,7 +26,7 @@ /*****************************************************************************/ #define _GNU_SOURCE // For asprintf -#include // For NULL +#include // For NULL #include // For aprintf #include // To access MySQL databases diff --git a/swad_info.c b/swad_info.c index 1fe77e3e..238fd58e 100644 --- a/swad_info.c +++ b/swad_info.c @@ -27,7 +27,7 @@ #include // For maximum values #include // For PATH_MAX, NAME_MAX -#include // For NULL +#include // For NULL #include // For getenv, etc #include // For SOAP_OK and soap functions #include // For string functions diff --git a/swad_institution.c b/swad_institution.c index b31a9129..ec37d185 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -25,7 +25,7 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include // For calloc #include // For string functions diff --git a/swad_layout.c b/swad_layout.c index b1f51efe..22e31c69 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -25,7 +25,7 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include // For exit #include // For string functions diff --git a/swad_link.c b/swad_link.c index 940af738..1f91822a 100644 --- a/swad_link.c +++ b/swad_link.c @@ -25,7 +25,7 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include // For calloc #include // For string functions diff --git a/swad_mail.c b/swad_mail.c index 6b57a93a..47e557c0 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -25,7 +25,7 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include // For calloc #include // For string functions #include // For the macro WEXITSTATUS diff --git a/swad_main.c b/swad_main.c index 60cdebba..241dd381 100644 --- a/swad_main.c +++ b/swad_main.c @@ -25,7 +25,7 @@ /*********************************** Headers *********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include // For exit #include #include // For sleep diff --git a/swad_mark.c b/swad_mark.c index 196ffb7c..52bfe0c5 100644 --- a/swad_mark.c +++ b/swad_mark.c @@ -27,8 +27,8 @@ #define _GNU_SOURCE // For asprintf #include // For PATH_MAX -#include // For NULL #include // For malloc +#include // For NULL #include // For asprintf #include // For string functions #include // For unlink diff --git a/swad_match.c b/swad_match.c index 65d68a58..6d05ffbe 100644 --- a/swad_match.c +++ b/swad_match.c @@ -27,7 +27,7 @@ #define _GNU_SOURCE // For asprintf #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For asprintf #include // For calloc #include // For string functions diff --git a/swad_match_result.c b/swad_match_result.c index d546c247..c80c1e90 100644 --- a/swad_match_result.c +++ b/swad_match_result.c @@ -27,7 +27,7 @@ #define _GNU_SOURCE // For asprintf #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For asprintf #include // For calloc #include // For string functions diff --git a/swad_message.c b/swad_message.c index 5c015ff8..741dc84f 100644 --- a/swad_message.c +++ b/swad_message.c @@ -27,7 +27,7 @@ #define _GNU_SOURCE // For asprintf #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For asprintf #include // For free #include // For string functions diff --git a/swad_notice.c b/swad_notice.c index abf2dd4a..f00fb328 100644 --- a/swad_notice.c +++ b/swad_notice.c @@ -27,7 +27,7 @@ #define _GNU_SOURCE // For asprintf #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For sscanf, asprintf, etc. #include // For exit, system, malloc, calloc, free, etc. #include diff --git a/swad_notification.c b/swad_notification.c index ce2ea50e..6992d89c 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -25,7 +25,7 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include // For system #include #include // For the macro WEXITSTATUS diff --git a/swad_pagination.c b/swad_pagination.c index 477386ca..9af2dcf8 100644 --- a/swad_pagination.c +++ b/swad_pagination.c @@ -26,7 +26,7 @@ /*****************************************************************************/ #define _GNU_SOURCE // For asprintf -#include // For NULL +#include // For NULL #include // For asprintf #include // For free diff --git a/swad_parameter.c b/swad_parameter.c index 2531cabe..c3e8a6a4 100644 --- a/swad_parameter.c +++ b/swad_parameter.c @@ -26,7 +26,7 @@ /*****************************************************************************/ #include // For isprint, isspace, etc. -#include // For NULL +#include // For NULL #include // For calloc #include // For string functions diff --git a/swad_photo.c b/swad_photo.c index 185b172b..7e60d40b 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -27,8 +27,8 @@ #define _GNU_SOURCE // For asprintf #include // For PATH_MAX -#include // For NULL #include // For log10, floor, ceil, modf, sqrt... +#include // For NULL #include // For asprintf #include // For system, getenv, etc. #include // For string functions diff --git a/swad_place.c b/swad_place.c index 387bfd53..cf351246 100644 --- a/swad_place.c +++ b/swad_place.c @@ -25,7 +25,7 @@ /********************************** Headers **********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include // For calloc #include // For string functions diff --git a/swad_plugin.c b/swad_plugin.c index bb1cf61e..ffdbb636 100644 --- a/swad_plugin.c +++ b/swad_plugin.c @@ -29,8 +29,8 @@ TODO: Check if web service is called from an authorized IP. /*****************************************************************************/ #define _GNU_SOURCE // For asprintf -#include // For NULL #include // For boolean type +#include // For NULL #include // For fprintf, asprintf #include // For calloc, free #include diff --git a/swad_profile.c b/swad_profile.c index 3dc1e3af..ce6f4fd7 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -25,7 +25,7 @@ /*********************************** Headers *********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include // For string functions #include "swad_box.h" diff --git a/swad_project.c b/swad_project.c index 6668e500..38dd7bca 100644 --- a/swad_project.c +++ b/swad_project.c @@ -27,7 +27,7 @@ #define _GNU_SOURCE // For asprintf #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For asprintf #include // For calloc #include // For string functions diff --git a/swad_record.c b/swad_record.c index 97559f23..3dfbd5b3 100644 --- a/swad_record.c +++ b/swad_record.c @@ -27,7 +27,7 @@ #define _GNU_SOURCE // For asprintf #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For asprintf #include // For calloc #include diff --git a/swad_session.c b/swad_session.c index 0e1aaa65..dbcc5d91 100644 --- a/swad_session.c +++ b/swad_session.c @@ -25,8 +25,8 @@ /************************************ Headers ********************************/ /*****************************************************************************/ -#include // For NULL #include // To access MySQL databases +#include // For NULL #include // For sprintf #include // For malloc and free #include // For string functions diff --git a/swad_setting.c b/swad_setting.c index 2890adcf..37690868 100644 --- a/swad_setting.c +++ b/swad_setting.c @@ -25,8 +25,8 @@ /********************************** Headers **********************************/ /*****************************************************************************/ -#include // For NULL #include // For boolean type +#include // For NULL #include // For fprintf, etc. #include diff --git a/swad_string.c b/swad_string.c index 78fb9373..51366632 100644 --- a/swad_string.c +++ b/swad_string.c @@ -26,10 +26,10 @@ /*****************************************************************************/ #define _GNU_SOURCE // For asprintf -#include // For NULL #include // For isprint, isspace, etc. #include // For setlocale #include // For log10, floor, ceil, modf, sqrt... +#include // For NULL #include // For asprintf #include // For malloc and free #include // For string functions diff --git a/swad_survey.c b/swad_survey.c index 36b4830c..fefab82f 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -27,7 +27,7 @@ #define _GNU_SOURCE // For asprintf #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For asprintf #include // For calloc #include // For string functions diff --git a/swad_syllabus.c b/swad_syllabus.c index 7e8828c2..88999d70 100644 --- a/swad_syllabus.c +++ b/swad_syllabus.c @@ -27,9 +27,9 @@ #include // For SEEK_SET #include // For PATH_MAX -#include // For NULL -#include // For SOAP_OK and soap functions +#include // For NULL #include // For free () +#include // For SOAP_OK and soap functions #include // For string functions #include // For time () diff --git a/swad_test.c b/swad_test.c index df3edce5..6c58358a 100644 --- a/swad_test.c +++ b/swad_test.c @@ -28,9 +28,9 @@ #define _GNU_SOURCE // For asprintf #include // For UINT_MAX #include // For PATH_MAX -#include // For NULL #include // To access MySQL databases #include // For boolean type +#include // For NULL #include // For fprintf, asprintf, etc. #include // For exit, system, malloc, free, etc #include // For string functions diff --git a/swad_text.c b/swad_text.c index ef960d41..c360ea0d 100644 --- a/swad_text.c +++ b/swad_text.c @@ -54,7 +54,7 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ -#include // For NULL +#include // For NULL #include "swad_action.h" #include "swad_assignment.h" diff --git a/swad_timetable.c b/swad_timetable.c index 1facc709..419091e6 100644 --- a/swad_timetable.c +++ b/swad_timetable.c @@ -26,7 +26,7 @@ /*****************************************************************************/ #define _GNU_SOURCE // For asprintf -#include // For NULL +#include // For NULL #include // For asprintf #include // For malloc, calloc, free #include // For string functions diff --git a/swad_user.c b/swad_user.c index 1950f753..df47f38f 100644 --- a/swad_user.c +++ b/swad_user.c @@ -29,7 +29,7 @@ #include // For isalnum, isdigit, etc. #include // For maximum values #include // For PATH_MAX -#include // For NULL +#include // For NULL #include // For asprintf #include // For exit, system, malloc, free, rand, etc. #include // For string functions diff --git a/swad_xml.c b/swad_xml.c index a61fc202..16f616a2 100644 --- a/swad_xml.c +++ b/swad_xml.c @@ -26,7 +26,7 @@ /*****************************************************************************/ #include // For isspace() -#include // For NULL +#include // For NULL #include // For free () #include // For strlen (), etc.