Version 22.50.2: Oct 19, 2022 Code refactoring related to dates.

This commit is contained in:
acanas 2022-10-19 18:07:49 +02:00
parent 84c32104d8
commit cc8b64cf3c
98 changed files with 168 additions and 50 deletions

View File

@ -120,6 +120,7 @@ cp -f /home/acanas/swad/swad/swad /var/www/cgi-bin/
#include "swad_hierarchy_level.h"
#include "swad_ID.h"
#include "swad_mail_database.h"
#include "swad_mark.h"
#include "swad_match.h"
#include "swad_match_database.h"
#include "swad_message_database.h"

View File

@ -30,6 +30,7 @@
#include <stdio.h> // For vasprintf
#include <stdlib.h> // For free
#include "swad_alert.h"
#include "swad_error.h"
#include "swad_global.h"
#include "swad_HTML.h"

View File

@ -33,6 +33,7 @@
#include <string.h> // For string functions
#include "swad_account.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"

View File

@ -30,6 +30,8 @@
#include <stdlib.h> // For free
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_error.h"
#include "swad_global.h"
#include "swad_HTML.h"

View File

@ -90,6 +90,7 @@
#include "swad_password.h"
#include "swad_photo.h"
#include "swad_place.h"
#include "swad_plugin.h"
#include "swad_privacy.h"
#include "swad_profile.h"
#include "swad_program.h"
@ -101,6 +102,7 @@
#include "swad_report.h"
#include "swad_role.h"
#include "swad_search.h"
#include "swad_session.h"
#include "swad_setting.h"
#include "swad_survey.h"
#include "swad_survey_resource.h"

View File

@ -29,6 +29,7 @@
#include "swad_admin.h"
#include "swad_admin_database.h"
#include "swad_alert.h"
#include "swad_global.h"
#include "swad_user_database.h"

View File

@ -25,6 +25,7 @@
/*********************************** Headers *********************************/
/*****************************************************************************/
#include "swad_alert.h"
#include "swad_announcement.h"
#include "swad_announcement_database.h"
#include "swad_autolink.h"

View File

@ -29,6 +29,7 @@
#include <stdlib.h> // For calloc
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_banner.h"
#include "swad_banner_database.h"
#include "swad_box.h"

View File

@ -38,6 +38,7 @@
#include <time.h> // For time
#include <unistd.h> // For access, lstat, getpid, chdir, symlink
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_browser.h"
#include "swad_browser_database.h"

View File

@ -25,6 +25,7 @@
/*****************************************************************************/
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_browser.h"
#include "swad_browser_resource.h"
#include "swad_error.h"

View File

@ -29,6 +29,7 @@
#include <stddef.h> // For NULL
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_building.h"
#include "swad_building_database.h"
@ -37,6 +38,7 @@
#include "swad_form.h"
#include "swad_global.h"
#include "swad_HTML.h"
#include "swad_parameter.h"
#include "swad_room_database.h"
/*****************************************************************************/

View File

@ -31,6 +31,7 @@
#include <stdlib.h> // For exit, system, malloc, calloc, free, etc.
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_call_for_exam.h"
#include "swad_call_for_exam_database.h"

View File

@ -33,6 +33,7 @@
#include <string.h> // For string functions
#include "swad_admin_database.h"
#include "swad_box.h"
#include "swad_browser_database.h"
#include "swad_center.h"
#include "swad_center_config.h"
@ -50,6 +51,7 @@
#include "swad_HTML.h"
#include "swad_logo.h"
#include "swad_message.h"
#include "swad_parameter.h"
#include "swad_place.h"
#include "swad_room_database.h"
#include "swad_survey.h"

View File

@ -33,6 +33,8 @@
#include <string.h> // For string functions
#include <unistd.h> // For unlink
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_center.h"
#include "swad_center_database.h"
#include "swad_database.h"
@ -46,6 +48,7 @@
#include "swad_hierarchy_level.h"
#include "swad_HTML.h"
#include "swad_logo.h"
#include "swad_parameter.h"
#include "swad_place.h"
/*****************************************************************************/

View File

@ -36,6 +36,7 @@
#include "swad_global.h"
#include "swad_hierarchy.h"
#include "swad_hierarchy_database.h"
#include "swad_media.h"
#include "swad_search.h"
/*****************************************************************************/

View File

@ -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.50.1 (2022-10-19)"
#define Log_PLATFORM_VERSION "SWAD 22.50.2 (2022-10-19)"
#define CSS_FILE "swad22.49.4.css"
#define JS_FILE "swad22.49.js"
/*
Version 22.50.2: Oct 19, 2022 Code refactoring related to dates. (333456 lines)
Version 22.50.1: Oct 19, 2022 Code refactoring related to dates. (333332 lines)
Version 22.50: Oct 19, 2022 Code refactoring related to dates. (333318 lines)
Version 22.49.9: Oct 18, 2022 Code refactoring related to XML. (333257 lines)

View File

@ -29,6 +29,7 @@
#include <stdbool.h> // For boolean type
#include <string.h>
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_chat.h"
#include "swad_chat_database.h"

View File

@ -72,7 +72,7 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Ro
static unsigned Con_GetConnectedUsrsTotal (Rol_Role_t Role);
static void Con_GetNumConnectedWithARoleBelongingToCurrentScope (Rol_Role_t Role,
struct ConnectedUsrs *Usrs);
struct Con_ConnectedUsrs *Usrs);
static void Con_ComputeConnectedUsrsWithARoleCurrentCrsOneByOne (Rol_Role_t Role);
static void Con_ShowConnectedUsrsCurrentCrsOneByOneOnRightColumn (Rol_Role_t Role);
static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role);
@ -267,7 +267,7 @@ static void Con_ComputeConnectedUsrsWithARoleBelongingToCurrentCrs (Rol_Role_t R
static void Con_ShowConnectedUsrsBelongingToLocation (void)
{
extern const char *Txt_from;
struct ConnectedUsrs Usrs;
struct Con_ConnectedUsrs Usrs;
/***** Begin container *****/
HTM_DIV_Begin ("class=\"CON CON_%s\"",
@ -312,7 +312,7 @@ void Con_ShowConnectedUsrsBelongingToCurrentCrs (void)
extern const char *Txt_Connected_users;
extern const char *Txt_from;
char CourseName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1];
struct ConnectedUsrs Usrs;
struct Con_ConnectedUsrs Usrs;
/***** Trivial check *****/
if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected
@ -354,7 +354,7 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentLocationOnMainZone (
{
extern const char *Txt_ROLES_SINGUL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
struct ConnectedUsrs Usrs;
struct Con_ConnectedUsrs Usrs;
/***** Write number of connected users who belong to current course *****/
Con_GetNumConnectedWithARoleBelongingToCurrentScope (Role,&Usrs);
@ -442,7 +442,7 @@ static unsigned Con_GetConnectedUsrsTotal (Rol_Role_t Role)
// Return user's sex in UsrSex
static void Con_GetNumConnectedWithARoleBelongingToCurrentScope (Rol_Role_t Role,
struct ConnectedUsrs *Usrs)
struct Con_ConnectedUsrs *Usrs)
{
extern const char *Usr_StringsSexDB[Usr_NUM_SEXS];
MYSQL_RES *mysql_res;

View File

@ -40,7 +40,7 @@
/******************************** Public types *******************************/
/*****************************************************************************/
struct ConnectedUsrs
struct Con_ConnectedUsrs
{
unsigned NumUsrs;
Usr_Sex_t Sex;

View File

@ -39,6 +39,7 @@
#include "swad_global.h"
#include "swad_HTML.h"
#include "swad_layout.h"
#include "swad_parameter.h"
#include "swad_setting.h"
#include "swad_user_database.h"

View File

@ -32,6 +32,8 @@
#include <stdlib.h> // For free
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_country_config.h"
#include "swad_country_database.h"
#include "swad_database.h"
@ -43,6 +45,7 @@
#include "swad_hierarchy.h"
#include "swad_hierarchy_level.h"
#include "swad_HTML.h"
#include "swad_parameter.h"
#include "swad_survey.h"
/*****************************************************************************/

View File

@ -32,6 +32,7 @@
#include <stdlib.h> // For free
#include <string.h> // For string functions
#include "swad_box.h"
#include "swad_country_config.h"
#include "swad_country_database.h"
#include "swad_database.h"
@ -44,6 +45,7 @@
#include "swad_hierarchy_config.h"
#include "swad_hierarchy_level.h"
#include "swad_HTML.h"
#include "swad_parameter.h"
/*****************************************************************************/
/************** External global variables from others modules ****************/

View File

@ -32,6 +32,7 @@
#include <string.h> // For string functions
#include "swad_attendance.h"
#include "swad_box.h"
#include "swad_browser_database.h"
#include "swad_call_for_exam_database.h"
#include "swad_center_database.h"
@ -60,6 +61,7 @@
#include "swad_notice.h"
#include "swad_notice_database.h"
#include "swad_notification_database.h"
#include "swad_parameter.h"
#include "swad_project.h"
#include "swad_record_database.h"
#include "swad_search.h"

View File

@ -64,7 +64,7 @@ struct Crs_Course
char FullName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1]; // Full name of course
};
struct ListCourses
struct Crs_ListCourses
{
unsigned Num; // Number of courses
struct Crs_Course *Lst; // List of courses

View File

@ -32,6 +32,8 @@
#include <stdlib.h> // For free
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_course_database.h"
#include "swad_database.h"
#include "swad_error.h"
@ -43,6 +45,7 @@
#include "swad_HTML.h"
#include "swad_indicator.h"
#include "swad_logo.h"
#include "swad_parameter.h"
#include "swad_role.h"
/*****************************************************************************/

View File

@ -34,6 +34,7 @@
#include <stdlib.h> // For free
#include <string.h> // For strlen
#include "swad_alert.h"
#include "swad_config.h"
#include "swad_database.h"
#include "swad_error.h"

View File

@ -33,6 +33,7 @@
#include <string.h> // For string functions
#include "swad_admin_database.h"
#include "swad_box.h"
#include "swad_browser_database.h"
#include "swad_course_database.h"
#include "swad_database.h"
@ -50,6 +51,7 @@
#include "swad_HTML.h"
#include "swad_logo.h"
#include "swad_message.h"
#include "swad_parameter.h"
#include "swad_photo_database.h"
#include "swad_survey.h"

View File

@ -30,6 +30,8 @@
#include <stdio.h> // For asprintf
#include <stdlib.h> // For free
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_degree_config.h"
#include "swad_degree_database.h"
@ -42,6 +44,7 @@
#include "swad_hierarchy_level.h"
#include "swad_HTML.h"
#include "swad_logo.h"
#include "swad_parameter.h"
/*****************************************************************************/
/************** External global variables from others modules ****************/

View File

@ -32,6 +32,7 @@
#include <string.h> // For string functions
#include <mysql/mysql.h> // To access MySQL databases
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_config.h"
#include "swad_database.h"

View File

@ -32,6 +32,7 @@
#include <stdlib.h> // For calloc
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_constant.h"
#include "swad_database.h"

View File

@ -26,6 +26,7 @@
/*****************************************************************************/
#include "swad_account.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_duplicate.h"
@ -37,6 +38,7 @@
#include "swad_global.h"
#include "swad_HTML.h"
#include "swad_layout.h"
#include "swad_parameter.h"
#include "swad_profile.h"
#include "swad_role_type.h"
#include "swad_user.h"

View File

@ -34,6 +34,7 @@
#include "swad_account_database.h"
#include "swad_admin.h"
#include "swad_admin_database.h"
#include "swad_alert.h"
#include "swad_announcement.h"
#include "swad_attendance_database.h"
#include "swad_box.h"

View File

@ -27,6 +27,7 @@
#include <stdlib.h> // For exit
#include "swad_alert.h"
#include "swad_database.h"
#include "swad_error.h"
#include "swad_global.h"

View File

@ -34,6 +34,7 @@
#include <string.h> // For string functions
#include "swad_autolink.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"
#include "swad_exam.h"
@ -51,6 +52,7 @@
#include "swad_match.h"
#include "swad_match_result.h"
#include "swad_pagination.h"
#include "swad_parameter.h"
#include "swad_program_database.h"
#include "swad_role.h"
#include "swad_test.h"

View File

@ -31,6 +31,7 @@
#include <string.h> // For string functions
#include "swad_action.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"
#include "swad_exam_database.h"

View File

@ -31,6 +31,7 @@
#include <stdio.h> // For asprintf
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_autolink.h"
#include "swad_box.h"
#include "swad_database.h"
@ -46,6 +47,7 @@
#include "swad_form.h"
#include "swad_global.h"
#include "swad_ID.h"
#include "swad_parameter.h"
#include "swad_photo.h"
/*****************************************************************************/

View File

@ -33,6 +33,7 @@
#include <string.h> // For string functions
#include "swad_action.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_date.h"
#include "swad_error.h"
@ -48,6 +49,7 @@
#include "swad_global.h"
#include "swad_HTML.h"
#include "swad_ID.h"
#include "swad_parameter.h"
#include "swad_photo.h"
#include "swad_test_print.h"
#include "swad_test_visibility.h"

View File

@ -32,6 +32,8 @@
#include <stdlib.h> // For free
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_date.h"
#include "swad_error.h"
@ -46,6 +48,7 @@
#include "swad_global.h"
#include "swad_group_database.h"
#include "swad_HTML.h"
#include "swad_parameter.h"
#include "swad_role.h"
#include "swad_setting.h"
#include "swad_test.h"

View File

@ -33,6 +33,7 @@
#include <stdlib.h> // For free
#include <string.h> // For string functions
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"
#include "swad_exam.h"
@ -48,6 +49,7 @@
#include "swad_match.h"
#include "swad_match_result.h"
#include "swad_pagination.h"
#include "swad_parameter.h"
#include "swad_question_database.h"
#include "swad_role.h"
#include "swad_test.h"

View File

@ -30,16 +30,19 @@
#include "swad_box.h"
#include "swad_calendar.h"
#include "swad_cookie.h"
#include "swad_degree_type.h"
#include "swad_exam.h"
#include "swad_figure.h"
#include "swad_follow.h"
#include "swad_form.h"
#include "swad_forum.h"
#include "swad_global.h"
#include "swad_hierarchy.h"
#include "swad_HTML.h"
#include "swad_message.h"
#include "swad_network.h"
#include "swad_notice.h"
#include "swad_parameter.h"
#include "swad_privacy.h"
#include "swad_program.h"
#include "swad_project.h"

View File

@ -43,6 +43,7 @@
#include "swad_global.h"
#include "swad_file.h"
#include "swad_file_database.h"
#include "swad_parameter.h"
#include "swad_string.h"
/*****************************************************************************/

View File

@ -45,7 +45,7 @@
#define Fil_MAX_FILE_SIZE (2000ULL * 1024ULL * 1024ULL) // 2000 MiB = 1.95 GiB
// Global files
struct Files
struct Fil_Files
{
FILE *Out; // File with the HTML output of this CGI
FILE *Tmp; // Temporary file to save stdin

View File

@ -30,6 +30,7 @@
#include <stdio.h> // For asprintf
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"
@ -41,6 +42,7 @@
#include "swad_HTML.h"
#include "swad_notification.h"
#include "swad_notification_database.h"
#include "swad_parameter.h"
#include "swad_photo.h"
#include "swad_privacy.h"
#include "swad_profile.h"

View File

@ -34,6 +34,7 @@
#include <string.h> // For string functions
#include "swad_autolink.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"
#include "swad_figure.h"
@ -47,6 +48,7 @@
#include "swad_match_database.h"
#include "swad_match_result.h"
#include "swad_pagination.h"
#include "swad_parameter.h"
#include "swad_program_database.h"
#include "swad_role.h"
#include "swad_test.h"

View File

@ -39,6 +39,7 @@
#include "swad_call_for_exam.h"
#include "swad_config.h"
#include "swad_constant.h"
#include "swad_degree_type.h"
#include "swad_department.h"
#include "swad_follow.h"
#include "swad_global.h"
@ -47,6 +48,7 @@
#include "swad_icon.h"
#include "swad_link.h"
#include "swad_parameter.h"
#include "swad_plugin.h"
#include "swad_program.h"
#include "swad_project.h"
#include "swad_role.h"

View File

@ -32,34 +32,17 @@
#include <sys/time.h> // For tz
#include <mysql/mysql.h> // To access MySQL databases
#include "swad_alert.h"
#include "swad_API.h"
#include "swad_assignment.h"
#include "swad_box.h"
#include "swad_browser.h"
#include "swad_center.h"
#include "swad_connected.h"
#include "swad_config.h"
#include "swad_country.h"
#include "swad_course.h"
#include "swad_cryptography.h"
#include "swad_degree_type.h"
#include "swad_enrolment.h"
#include "swad_file.h"
#include "swad_icon.h"
#include "swad_institution.h"
#include "swad_layout.h"
#include "swad_group.h"
#include "swad_mail.h"
#include "swad_mark.h"
#include "swad_media.h"
#include "swad_menu.h"
#include "swad_parameter.h"
#include "swad_password.h"
#include "swad_plugin.h"
#include "swad_record.h"
#include "swad_search.h"
#include "swad_session.h"
#include "swad_setting.h"
/*****************************************************************************/
/******************************* Public types ********************************/
@ -72,10 +55,10 @@ struct Globals
char DatabasePassword[Cfg_MAX_BYTES_DATABASE_PASSWORD + 1];
char SMTPPassword[Cfg_MAX_BYTES_SMTP_PASSWORD + 1];
} Config;
struct Files F;
struct Fil_Files F;
pid_t PID; // PID of current process
char IP[Cns_MAX_BYTES_IP + 1];
char UniqueNameEncrypted[Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64 + 1]; // Used for session id, temporary directory names, etc.
struct
{
bool WritingHTMLStart; // Used to avoid writing the HTML head when aborting program on error
@ -84,9 +67,6 @@ struct Globals
bool HTMLEndWritten; // Used to avoid writing more than once the HTML end
} Layout;
char IP[Cns_MAX_BYTES_IP + 1];
char UniqueNameEncrypted[Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64 + 1]; // Used for session id, temporary directory names, etc.
struct
{
Lan_Language_t Language;
@ -98,7 +78,6 @@ struct Globals
unsigned SideCols;
PhoSha_Shape_t PhotoShape;
} Prefs;
struct
{
unsigned NumSessions;
@ -108,7 +87,6 @@ struct Globals
long UsrCod;
bool ParamsInsertedIntoDB; // If parameters are inserted in the database in this session
} Session;
struct
{
Tab_Tab_t Tab;
@ -117,7 +95,6 @@ struct Globals
bool UsesAJAX; // Do not generate full HTML page, only the content of a div
bool IsAJAXAutoRefresh; // It's an automatic refresh drom time to time
} Action;
struct
{
HieLvl_Level_t Level; // Current level in the hierarchy: system, country, institution, center, degree or course
@ -130,7 +107,7 @@ struct Globals
struct Ctr_Center Ctr; // Current center
struct ListDegrees Degs; // List of degrees in current center
struct Deg_Degree Deg; // Current degree
struct ListCourses Crss; // List of courses in current degree
struct Crs_ListCourses Crss; // List of courses in current degree
struct Crs_Course Crs; // Current course. Aditional info about course is stored in Gbl.Crs.
} Hierarchy;
struct
@ -155,10 +132,10 @@ struct Globals
char Str[Sch_MAX_BYTES_STRING_TO_FIND + 1];
bool LogSearch;
} Search;
struct
struct
{
unsigned Num; // Number of plugins
struct Plugin *Lst; // List of plugins
struct Plg_Plugin *Lst; // List of plugins
} Plugins;
struct
{
@ -276,7 +253,7 @@ struct Globals
unsigned NumUsr;
unsigned NumUsrs;
unsigned NumUsrsToList;
struct ConnectedUsrs Usrs[Rol_NUM_ROLES];
struct Con_ConnectedUsrs Usrs[Rol_NUM_ROLES];
struct
{
long UsrCod;

View File

@ -32,6 +32,7 @@
#include <string.h> // For string functions
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_assignment_database.h"
#include "swad_attendance_database.h"
#include "swad_box.h"

View File

@ -30,6 +30,7 @@
#include <stdlib.h> // For free
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_config.h"
#include "swad_error.h"

View File

@ -29,6 +29,7 @@
#include <stdio.h> // For asprintf
#include <stdlib.h> // For free
#include "swad_box.h"
#include "swad_database.h"
#include "swad_degree_database.h"
#include "swad_error.h"
@ -41,6 +42,7 @@
#include "swad_hierarchy_level.h"
#include "swad_HTML.h"
#include "swad_logo.h"
#include "swad_parameter.h"
/*****************************************************************************/
/************** External global variables from others modules ****************/

View File

@ -29,6 +29,7 @@
#include <stdlib.h> // For calloc
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_calendar.h"
#include "swad_database.h"

View File

@ -36,6 +36,7 @@
#include "swad_box.h"
#include "swad_browser_database.h"
#include "swad_database.h"
#include "swad_degree_type.h"
#include "swad_department.h"
#include "swad_error.h"
#include "swad_form.h"

View File

@ -34,6 +34,7 @@
#include <unistd.h> // For unlink
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_autolink.h"
#include "swad_box.h"
#include "swad_database.h"

View File

@ -33,6 +33,7 @@
#include <string.h> // For string functions
#include "swad_admin_database.h"
#include "swad_box.h"
#include "swad_browser_database.h"
#include "swad_center_database.h"
#include "swad_database.h"
@ -51,6 +52,7 @@
#include "swad_institution_database.h"
#include "swad_logo.h"
#include "swad_message.h"
#include "swad_parameter.h"
#include "swad_place.h"
#include "swad_survey.h"

View File

@ -31,6 +31,8 @@
#include <stdio.h> // For asprintf
#include <stdlib.h> // For free
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_center_database.h"
#include "swad_database.h"
#include "swad_department_database.h"
@ -46,6 +48,7 @@
#include "swad_institution.h"
#include "swad_institution_database.h"
#include "swad_logo.h"
#include "swad_parameter.h"
#include "swad_place.h"
/*****************************************************************************/

View File

@ -30,6 +30,7 @@
#include <stdlib.h> // For free
#include <string.h> // For strcasecmp
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"
@ -38,6 +39,7 @@
#include "swad_global.h"
#include "swad_HTML.h"
#include "swad_language.h"
#include "swad_parameter.h"
#include "swad_setting.h"
#include "swad_setting_database.h"
#include "swad_user_database.h"

View File

@ -29,6 +29,7 @@
#include <stdlib.h> // For calloc
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_banner.h"
#include "swad_box.h"
#include "swad_constant.h"

View File

@ -30,6 +30,7 @@
#include "swad_action.h"
#include "swad_banner.h"
#include "swad_box.h"
#include "swad_center_database.h"
#include "swad_config.h"
#include "swad_database.h"

View File

@ -31,6 +31,7 @@
#include <string.h> // For string functions
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_degree_database.h"
#include "swad_center_database.h"

View File

@ -34,6 +34,7 @@
#include <unistd.h> // For access, lstat, getpid, chdir, symlink, unlink
#include "swad_account.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"

View File

@ -44,6 +44,7 @@
#include "swad_MFU.h"
#include "swad_notification.h"
#include "swad_parameter.h"
#include "swad_session.h"
#include "swad_session_database.h"
#include "swad_setting.h"
#include "swad_user.h"

View File

@ -33,6 +33,7 @@
#include <string.h> // For string functions
#include <unistd.h> // For unlink
#include "swad_alert.h"
#include "swad_database.h"
#include "swad_enrolment_database.h"
#include "swad_error.h"

View File

@ -32,6 +32,8 @@
#include <stdlib.h> // For free
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_date.h"
#include "swad_error.h"
@ -44,6 +46,7 @@
#include "swad_match.h"
#include "swad_match_database.h"
#include "swad_match_result.h"
#include "swad_parameter.h"
#include "swad_question_database.h"
#include "swad_role.h"
#include "swad_setting.h"

View File

@ -33,6 +33,7 @@
#include <string.h> // For string functions
#include "swad_action.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_date.h"
#include "swad_error.h"
@ -43,6 +44,7 @@
#include "swad_match.h"
#include "swad_match_database.h"
#include "swad_match_result.h"
#include "swad_parameter.h"
#include "swad_photo.h"
#include "swad_test_visibility.h"
#include "swad_user.h"

View File

@ -36,6 +36,7 @@
#include <sys/wait.h> // For the macro WEXITSTATUS
#include <unistd.h> // For unlink, lstat
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_browser.h"
#include "swad_config.h"
@ -48,6 +49,7 @@
#include "swad_HTML.h"
#include "swad_media.h"
#include "swad_media_database.h"
#include "swad_parameter.h"
/*****************************************************************************/
/***************************** Private constants *****************************/

View File

@ -49,6 +49,7 @@
#include "swad_hierarchy_level.h"
#include "swad_HTML.h"
#include "swad_ID.h"
#include "swad_media.h"
#include "swad_message.h"
#include "swad_message_database.h"
#include "swad_nickname_database.h"

View File

@ -28,6 +28,7 @@
#include <string.h> // For string functions
#include "swad_account.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_form.h"

View File

@ -32,6 +32,7 @@
#include <stdlib.h> // For free
#include <string.h>
#include "swad_alert.h"
#include "swad_autolink.h"
#include "swad_box.h"
#include "swad_database.h"

View File

@ -38,6 +38,7 @@
#include "swad_HTML.h"
#include "swad_parameter.h"
#include "swad_password.h"
#include "swad_session.h"
#include "swad_setting.h"
#include "swad_tab.h"

View File

@ -36,6 +36,7 @@
#include <unistd.h> // For unlink
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_browser.h"
#include "swad_config.h"

View File

@ -31,11 +31,13 @@
#include <stdlib.h> // For free
#include "swad_action.h"
#include "swad_box.h"
#include "swad_config.h"
#include "swad_error.h"
#include "swad_figure.h"
#include "swad_form.h"
#include "swad_global.h"
#include "swad_parameter.h"
#include "swad_photo_shape.h"
#include "swad_setting_database.h"
#include "swad_user_database.h"

View File

@ -29,6 +29,7 @@
#include <stdlib.h> // For calloc
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_center_database.h"
#include "swad_constant.h"

View File

@ -61,7 +61,7 @@ extern struct Globals Gbl;
/***************************** Private variables *****************************/
/*****************************************************************************/
static struct Plugin *Plg_EditingPlg = NULL; // Static variable to keep the plugin being edited
static struct Plg_Plugin *Plg_EditingPlg = NULL; // Static variable to keep the plugin being edited
/*****************************************************************************/
/***************************** Private prototypes ****************************/
@ -88,7 +88,7 @@ void Plg_ListPlugins (void)
extern const char *Txt_Plugins;
extern const char *Txt_Plugin;
unsigned NumPlg;
struct Plugin *Plg;
struct Plg_Plugin *Plg;
char URL[Cns_MAX_BYTES_WWW + Cns_BYTES_SESSION_ID + 1];
char *Icon;
@ -219,7 +219,7 @@ static void Plg_GetListPlugins (void)
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned NumPlg;
struct Plugin *Plg;
struct Plg_Plugin *Plg;
/***** Get plugins from database *****/
if ((Gbl.Plugins.Num = Plg_DB_GetListPlugins (&mysql_res))) // Plugins found...
@ -262,7 +262,7 @@ static void Plg_GetListPlugins (void)
/*************************** Get data of a plugin ****************************/
/*****************************************************************************/
bool Plg_GetDataOfPluginByCod (struct Plugin *Plg)
bool Plg_GetDataOfPluginByCod (struct Plg_Plugin *Plg)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -328,7 +328,7 @@ void Plg_FreeListPlugins (void)
static void Plg_ListPluginsForEdition (void)
{
unsigned NumPlg;
struct Plugin *Plg;
struct Plg_Plugin *Plg;
char *Icon;
/***** Begin table *****/

View File

@ -43,7 +43,7 @@
/******************************* Public types ********************************/
/*****************************************************************************/
struct Plugin
struct Plg_Plugin
{
long PlgCod;
char Name[Plg_MAX_BYTES_PLUGIN_NAME + 1];
@ -60,7 +60,7 @@ struct Plugin
void Plg_ListPlugins (void);
void Plg_EditPlugins (void);
bool Plg_GetDataOfPluginByCod (struct Plugin *Plg);
bool Plg_GetDataOfPluginByCod (struct Plg_Plugin *Plg);
void Plg_FreeListPlugins (void);
long Plg_GetParamPlgCod (void);
void Plg_RemovePlugin (void);

View File

@ -32,7 +32,7 @@
/***************************** Create a new plugin ***************************/
/*****************************************************************************/
void Plg_DB_CreatePlugin (const struct Plugin *Plg)
void Plg_DB_CreatePlugin (const struct Plg_Plugin *Plg)
{
DB_QueryINSERT ("can not create plugin",
"INSERT INTO plg_plugins"

View File

@ -35,7 +35,7 @@
/****************************** Public prototypes ****************************/
/*****************************************************************************/
void Plg_DB_CreatePlugin (const struct Plugin *Plg);
void Plg_DB_CreatePlugin (const struct Plg_Plugin *Plg);
void Plg_DB_ChangeName (long PlgCod,
const char NewPlgName[Plg_MAX_BYTES_PLUGIN_NAME + 1]);
void Plg_DB_ChangeDescription (long PlgCod,

View File

@ -31,6 +31,7 @@
#include <string.h>
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_enrolment_database.h"
#include "swad_error.h"

View File

@ -30,8 +30,10 @@
#include <stdlib.h> // For free
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_assignment_resource.h"
#include "swad_attendance_resource.h"
#include "swad_box.h"
#include "swad_browser_resource.h"
#include "swad_call_for_exam_resource.h"
#include "swad_error.h"
@ -40,6 +42,7 @@
#include "swad_forum_resource.h"
#include "swad_game_resource.h"
#include "swad_global.h"
#include "swad_parameter.h"
#include "swad_program.h"
#include "swad_program_database.h"
#include "swad_program_resource.h"

View File

@ -30,12 +30,15 @@
#include <stdlib.h> // For free
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"
#include "swad_exam_set.h"
#include "swad_figure.h"
#include "swad_form.h"
#include "swad_global.h"
#include "swad_parameter.h"
#include "swad_question.h"
#include "swad_question_database.h"
#include "swad_question_import.h"

View File

@ -27,9 +27,11 @@
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_database.h"
#include "swad_error.h"
#include "swad_global.h"
#include "swad_parameter.h"
#include "swad_question.h"
#include "swad_test_print.h"

View File

@ -30,6 +30,7 @@
#include <sys/stat.h> // For mkdir
#include <sys/types.h> // For mkdir
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"

View File

@ -35,6 +35,7 @@
#include "swad_account.h"
#include "swad_account_database.h"
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_config.h"
#include "swad_database.h"

View File

@ -29,6 +29,7 @@
#include <stddef.h> // For NULL
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_building.h"
#include "swad_database.h"
@ -38,6 +39,7 @@
#include "swad_group_database.h"
#include "swad_HTML.h"
#include "swad_MAC.h"
#include "swad_parameter.h"
#include "swad_room.h"
#include "swad_room_database.h"

View File

@ -31,6 +31,7 @@
#include <stdlib.h> // For getenv, malloc
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_banner.h"
#include "swad_box.h"
#include "swad_database.h"
@ -43,6 +44,8 @@
#include "swad_ID.h"
#include "swad_log.h"
#include "swad_log_database.h"
#include "swad_parameter.h"
#include "swad_plugin.h"
#include "swad_profile.h"
#include "swad_role.h"
#include "swad_statistic.h"
@ -2729,7 +2732,7 @@ static void Sta_ShowNumHitsPerPlugin (Sta_CountType_t CountType,
unsigned NumHit;
struct Sta_Hits Hits;
MYSQL_ROW row;
struct Plugin Plg;
struct Plg_Plugin Plg;
/***** Write heading *****/
HTM_TR_Begin (NULL);

View File

@ -33,9 +33,11 @@
#include <stdlib.h> // For free
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_error.h"
#include "swad_global.h"
#include "swad_notification_database.h"
#include "swad_parameter.h"
#include "swad_string.h"
/*****************************************************************************/

View File

@ -33,10 +33,13 @@
#include <string.h> // For string functions
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"
#include "swad_form.h"
#include "swad_global.h"
#include "swad_parameter.h"
#include "swad_tag.h"
#include "swad_tag_database.h"
#include "swad_theme.h"

View File

@ -38,6 +38,7 @@
#include <sys/types.h> // For mkdir
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"

View File

@ -34,12 +34,15 @@
#include <string.h> // For string functions
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_database.h"
#include "swad_error.h"
#include "swad_form.h"
#include "swad_global.h"
#include "swad_HTML.h"
#include "swad_ID.h"
#include "swad_parameter.h"
#include "swad_photo.h"
#include "swad_question.h"
#include "swad_question_database.h"

View File

@ -128,6 +128,7 @@ mysql> SHOW TABLES LIKE 'tml_%';
#include <stdio.h> // For asprintf
#include <stdlib.h> // For free
#include "swad_box.h"
#include "swad_error.h"
#include "swad_figure.h"
#include "swad_global.h"

View File

@ -30,11 +30,13 @@
#include <stdio.h> // For asprintf
#include <stdlib.h> // For free
#include "swad_box.h"
#include "swad_error.h"
#include "swad_forum.h"
#include "swad_global.h"
#include "swad_message.h"
#include "swad_notification_database.h"
#include "swad_parameter.h"
#include "swad_photo.h"
#include "swad_profile.h"
#include "swad_timeline.h"

View File

@ -30,6 +30,7 @@
#include <stdlib.h> // For free
#include "swad_action.h"
#include "swad_alert.h"
#include "swad_error.h"
#include "swad_global.h"
#include "swad_timeline.h"

View File

@ -41,6 +41,7 @@
#include "swad_hierarchy.h"
#include "swad_notice.h"
#include "swad_notification_database.h"
#include "swad_parameter.h"
#include "swad_photo.h"
#include "swad_profile.h"
#include "swad_timeline.h"

View File

@ -29,12 +29,14 @@
#include <stdio.h> // For asprintf
#include <stdlib.h> // For free
#include "swad_alert.h"
#include "swad_database.h"
#include "swad_error.h"
#include "swad_global.h"
#include "swad_info.h"
#include "swad_media.h"
#include "swad_message.h"
#include "swad_parameter.h"
#include "swad_profile.h"
#include "swad_timeline.h"
#include "swad_timeline_database.h"

View File

@ -32,6 +32,7 @@
#include "swad_follow.h"
#include "swad_follow_database.h"
#include "swad_global.h"
#include "swad_parameter.h"
#include "swad_profile.h"
#include "swad_profile_database.h"
#include "swad_timeline.h"

View File

@ -31,6 +31,7 @@
#include <stdio.h> // For asprintf
#include <stdlib.h> // For free
#include "swad_alert.h"
#include "swad_error.h"
#include "swad_global.h"
#include "swad_photo.h"

View File

@ -25,6 +25,7 @@
/*********************************** Headers *********************************/
/*****************************************************************************/
#include "swad_alert.h"
#include "swad_database.h"
#include "swad_follow.h"
#include "swad_global.h"

View File

@ -31,6 +31,7 @@
#include <stdlib.h> // For malloc, calloc, free
#include <string.h> // For string functions
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_calendar.h"
#include "swad_database.h"

View File

@ -83,6 +83,7 @@
#include "swad_record.h"
#include "swad_record_database.h"
#include "swad_role.h"
#include "swad_session.h"
#include "swad_session_database.h"
#include "swad_setting.h"
#include "swad_tab.h"

View File

@ -36,6 +36,7 @@
#include <sys/types.h> // For mkdir...
#include <unistd.h> // For chdir...
#include "swad_alert.h"
#include "swad_box.h"
#include "swad_browser.h"
#include "swad_browser_database.h"