Version20.23

This commit is contained in:
acanas 2021-02-11 00:58:53 +01:00
parent 312e7b14eb
commit 05deafa793
59 changed files with 3202 additions and 2948 deletions

View File

@ -61,8 +61,8 @@ OBJS = swad_account.o swad_action.o swad_agenda.o swad_alert.o \
swad_system_config.o \
swad_tab.o swad_tag.o swad_test.o swad_test_config.o \
swad_test_import.o swad_test_print.o swad_test_visibility.o \
swad_theme.o \
swad_timeline.o swad_timeline_favourite.o swad_timeline_share.o \
swad_theme.o swad_timeline.o swad_timeline_comment.o \
swad_timeline_favourite.o swad_timeline_note.o swad_timeline_share.o \
swad_timetable.o \
swad_user.o \
swad_xml.o \

View File

@ -3336,10 +3336,10 @@ int swad__getNotifications (struct soap *soap,
Ntf_NotifyEvent_t NotifyEvent;
long EventTime;
char PhotoURL[Cns_MAX_BYTES_WWW + 1];
struct Instit Ins;
struct Centre Ctr;
struct Degree Deg;
struct Course Crs;
struct Ins_Instit Ins;
struct Ctr_Centre Ctr;
struct Deg_Degree Deg;
struct Crs_Course Crs;
long Cod;
struct For_Forum ForumSelected;
char ForumName[For_MAX_BYTES_FORUM_NAME + 1];

View File

@ -50,14 +50,14 @@ extern struct Globals Gbl;
/***************************** Private prototypes ****************************/
/*****************************************************************************/
static void RSS_WriteNotices (FILE *FileRSS,struct Course *Crs);
static void RSS_WriteExamAnnouncements (FILE *FileRSS,struct Course *Crs);
static void RSS_WriteNotices (FILE *FileRSS,struct Crs_Course *Crs);
static void RSS_WriteExamAnnouncements (FILE *FileRSS,struct Crs_Course *Crs);
/*****************************************************************************/
/******* Update RSS archive with active notices in the current course ********/
/*****************************************************************************/
void RSS_UpdateRSSFileForACrs (struct Course *Crs)
void RSS_UpdateRSSFileForACrs (struct Crs_Course *Crs)
{
char PathRelPublRSSDir[PATH_MAX + 1];
char PathRelPublRSSFile[PATH_MAX + 1 + NAME_MAX + 1];
@ -147,7 +147,7 @@ void RSS_UpdateRSSFileForACrs (struct Course *Crs)
/************* Write notices of a course as items of RSS file ****************/
/*****************************************************************************/
static void RSS_WriteNotices (FILE *FileRSS,struct Course *Crs)
static void RSS_WriteNotices (FILE *FileRSS,struct Crs_Course *Crs)
{
extern const char *Txt_Notice;
MYSQL_RES *mysql_res;
@ -243,7 +243,7 @@ static void RSS_WriteNotices (FILE *FileRSS,struct Course *Crs)
/******** Write exam announcements of a course as items of RSS file **********/
/*****************************************************************************/
static void RSS_WriteExamAnnouncements (FILE *FileRSS,struct Course *Crs)
static void RSS_WriteExamAnnouncements (FILE *FileRSS,struct Crs_Course *Crs)
{
extern const char *Txt_Exam;
MYSQL_RES *mysql_res;

View File

@ -39,7 +39,7 @@
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void RSS_UpdateRSSFileForACrs (struct Course *Crs);
void RSS_UpdateRSSFileForACrs (struct Crs_Course *Crs);
void RSS_BuildRSSLink (char RSSLink[Cns_MAX_BYTES_WWW + 1],long CrsCod);
#endif

View File

@ -95,6 +95,7 @@
#include "swad_tag.h"
#include "swad_test_import.h"
#include "swad_timeline.h"
#include "swad_timeline_comment.h"
#include "swad_timeline_favourite.h"
#include "swad_timeline_share.h"
#include "swad_timetable.h"
@ -143,8 +144,8 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
[ActRefNewTL_PubGbl ] = {1509,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_AJAX_RFRESH,TL_GetParamWho ,TL_RefreshNewTimelineGbl ,NULL},
[ActRefOldTL_PubGbl ] = {1510,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,TL_GetParamWho ,TL_RefreshOldTimelineGbl ,NULL},
[ActRcvTL_PstGbl ] = {1492,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_ReceivePostGbl ,NULL},
[ActRcvTL_ComGbl ] = {1503,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_ReceiveCommentGbl ,NULL},
[ActShoHidTL_ComGbl ] = {1806,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_ShowHiddenCommentsGbl ,NULL},
[ActRcvTL_ComGbl ] = {1503,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_Com_ReceiveCommentGbl ,NULL},
[ActShoHidTL_ComGbl ] = {1806,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Com_ShowHiddenCommentsGbl ,NULL},
[ActAllShaTL_NotGbl ] = {1766,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_ShowAllSharersNoteGbl ,NULL},
[ActAllFavTL_NotGbl ] = {1767,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_ShowAllFaversNoteGbl ,NULL},
[ActAllFavTL_ComGbl ] = {1768,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_ShowAllFaversComGbl ,NULL},
@ -154,17 +155,17 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
[ActUnfTL_NotGbl ] = {1513,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_UnfNoteGbl ,NULL},
[ActFavTL_ComGbl ] = {1516,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_FavCommentGbl ,NULL},
[ActUnfTL_ComGbl ] = {1517,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_UnfCommentGbl ,NULL},
[ActReqRemTL_PubGbl ] = {1494,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_RequestRemNoteGbl ,NULL},
[ActRemTL_PubGbl ] = {1493,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_RemoveNoteGbl ,NULL},
[ActReqRemTL_ComGbl ] = {1505,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_RequestRemComGbl ,NULL},
[ActRemTL_ComGbl ] = {1507,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_RemoveComGbl ,NULL},
[ActReqRemTL_PubGbl ] = {1494,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_Not_RequestRemNoteGbl ,NULL},
[ActRemTL_PubGbl ] = {1493,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_Not_RemoveNoteGbl ,NULL},
[ActReqRemTL_ComGbl ] = {1505,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_Com_RequestRemComGbl ,NULL},
[ActRemTL_ComGbl ] = {1507,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_Com_RemoveComGbl ,NULL},
[ActReqOthPubPrf ] = {1401,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_RequestUserProfile ,NULL},
[ActRefOldTL_PubUsr ] = {1511,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_RefreshOldTimelineUsr ,NULL},
[ActRcvTL_PstUsr ] = {1498,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,NULL ,TL_ReceivePostUsr ,NULL},
[ActRcvTL_ComUsr ] = {1504,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,NULL ,TL_ReceiveCommentUsr ,NULL},
[ActShoHidTL_ComUsr ] = {1807,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_ShowHiddenCommentsUsr ,NULL},
[ActRcvTL_ComUsr ] = {1504,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,NULL ,TL_Com_ReceiveCommentUsr ,NULL},
[ActShoHidTL_ComUsr ] = {1807,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Com_ShowHiddenCommentsUsr ,NULL},
[ActAllShaTL_NotUsr ] = {1769,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_ShowAllSharersNoteUsr ,NULL},
[ActAllFavTL_NotUsr ] = {1770,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_ShowAllFaversNoteUsr ,NULL},
[ActAllFavTL_ComUsr ] = {1771,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_ShowAllFaversComUsr ,NULL},
@ -174,10 +175,10 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
[ActUnfTL_NotUsr ] = {1515,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_UnfNoteUsr ,NULL},
[ActFavTL_ComUsr ] = {1518,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_FavCommentUsr ,NULL},
[ActUnfTL_ComUsr ] = {1519,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_UnfCommentUsr ,NULL},
[ActReqRemTL_PubUsr ] = {1501,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RequestRemNoteUsr ,NULL},
[ActRemTL_PubUsr ] = {1502,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RemoveNoteUsr ,NULL},
[ActReqRemTL_ComUsr ] = {1506,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RequestRemComUsr ,NULL},
[ActRemTL_ComUsr ] = {1508,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RemoveComUsr ,NULL},
[ActReqRemTL_PubUsr ] = {1501,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_Not_RequestRemNoteUsr ,NULL},
[ActRemTL_PubUsr ] = {1502,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_Not_RemoveNoteUsr ,NULL},
[ActReqRemTL_ComUsr ] = {1506,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_Com_RequestRemComUsr ,NULL},
[ActRemTL_ComUsr ] = {1508,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_Com_RemoveComUsr ,NULL},
[ActSeeOthPubPrf ] = {1402,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_GetUsrDatAndShowUserProfile,NULL},
[ActCalFig ] = {1405,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_CalculateFigures ,NULL},

View File

@ -62,7 +62,7 @@ extern struct Globals Gbl;
/***************************** Private variables *****************************/
/*****************************************************************************/
static struct Centre *Ctr_EditingCtr = NULL; // Static variable to keep the centre being edited
static struct Ctr_Centre *Ctr_EditingCtr = NULL; // Static variable to keep the centre being edited
/*****************************************************************************/
/***************************** Private prototypes ****************************/
@ -72,16 +72,16 @@ static void Ctr_ListCentres (void);
static bool Ctr_CheckIfICanCreateCentres (void);
static void Ctr_PutIconsListingCentres (__attribute__((unused)) void *Args);
static void Ctr_PutIconToEditCentres (void);
static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr);
static void Ctr_ListOneCentreForSeeing (struct Ctr_Centre *Ctr,unsigned NumCtr);
static void Ctr_GetParamCtrOrder (void);
static void Ctr_EditCentresInternal (void);
static void Ctr_PutIconsEditingCentres (__attribute__((unused)) void *Args);
static void Ctr_GetDataOfCentreFromRow (struct Centre *Ctr,MYSQL_ROW row);
static void Ctr_GetDataOfCentreFromRow (struct Ctr_Centre *Ctr,MYSQL_ROW row);
static void Ctr_ListCentresForEdition (const struct Plc_Places *Places);
static bool Ctr_CheckIfICanEditACentre (struct Centre *Ctr);
static bool Ctr_CheckIfICanEditACentre (struct Ctr_Centre *Ctr);
static Ctr_StatusTxt_t Ctr_GetStatusTxtFromStatusBits (Ctr_Status_t Status);
static Ctr_Status_t Ctr_GetStatusBitsFromStatusTxt (Ctr_StatusTxt_t StatusTxt);
@ -103,7 +103,7 @@ static unsigned Ctr_GetNumCtrsInCty (long CtyCod);
static void Ctr_EditingCentreConstructor (void);
static void Ctr_EditingCentreDestructor (void);
static void Ctr_FormToGoToMap (struct Centre *Ctr);
static void Ctr_FormToGoToMap (struct Ctr_Centre *Ctr);
/*****************************************************************************/
/******************* List centres with pending degrees ***********************/
@ -120,7 +120,7 @@ void Ctr_SeeCtrWithPendingDegs (void)
MYSQL_ROW row;
unsigned NumCtrs;
unsigned NumCtr;
struct Centre Ctr;
struct Ctr_Centre Ctr;
const char *BgColor;
/***** Get centres with pending degrees *****/
@ -214,7 +214,7 @@ void Ctr_SeeCtrWithPendingDegs (void)
/******************** Draw centre logo and name with link ********************/
/*****************************************************************************/
void Ctr_DrawCentreLogoAndNameWithLink (struct Centre *Ctr,Act_Action_t Action,
void Ctr_DrawCentreLogoAndNameWithLink (struct Ctr_Centre *Ctr,Act_Action_t Action,
const char *ClassLink,const char *ClassLogo)
{
/***** Begin form *****/
@ -356,7 +356,7 @@ static void Ctr_PutIconToEditCentres (void)
/************************* List one centre for seeing ************************/
/*****************************************************************************/
static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr)
static void Ctr_ListOneCentreForSeeing (struct Ctr_Centre *Ctr,unsigned NumCtr)
{
extern const char *Txt_CENTRE_STATUS[Ctr_NUM_STATUS_TXT];
struct Plc_Place Plc;
@ -544,7 +544,7 @@ void Ctr_GetBasicListOfCentres (long InsCod)
MYSQL_ROW row;
unsigned long NumRows;
unsigned NumCtr;
struct Centre *Ctr;
struct Ctr_Centre *Ctr;
/***** Get centres from database *****/
NumRows = DB_QuerySELECT (&mysql_res,"can not get centres",
@ -570,8 +570,8 @@ void Ctr_GetBasicListOfCentres (long InsCod)
Gbl.Hierarchy.Ctrs.Num = (unsigned) NumRows;
/***** Create list with courses in degree *****/
if ((Gbl.Hierarchy.Ctrs.Lst = (struct Centre *) calloc (NumRows,
sizeof (struct Centre))) == NULL)
if ((Gbl.Hierarchy.Ctrs.Lst = (struct Ctr_Centre *) calloc (NumRows,
sizeof (struct Ctr_Centre))) == NULL)
Lay_NotEnoughMemoryExit ();
/***** Get the centres *****/
@ -612,7 +612,7 @@ void Ctr_GetFullListOfCentres (long InsCod)
MYSQL_ROW row;
unsigned long NumRows;
unsigned NumCtr;
struct Centre *Ctr;
struct Ctr_Centre *Ctr;
/***** Get centres from database *****/
NumRows = DB_QuerySELECT (&mysql_res,"can not get centres",
@ -659,8 +659,8 @@ void Ctr_GetFullListOfCentres (long InsCod)
Gbl.Hierarchy.Ctrs.Num = (unsigned) NumRows;
/***** Create list with courses in degree *****/
if ((Gbl.Hierarchy.Ctrs.Lst = (struct Centre *) calloc (NumRows,
sizeof (struct Centre))) == NULL)
if ((Gbl.Hierarchy.Ctrs.Lst = (struct Ctr_Centre *) calloc (NumRows,
sizeof (struct Ctr_Centre))) == NULL)
Lay_NotEnoughMemoryExit ();
/***** Get the centres *****/
@ -691,7 +691,7 @@ void Ctr_GetFullListOfCentres (long InsCod)
/************************ Get data of centre by code *************************/
/*****************************************************************************/
bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr)
bool Ctr_GetDataOfCentreByCod (struct Ctr_Centre *Ctr)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -748,7 +748,7 @@ bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr)
/********** Get data of a centre from a row resulting of a query *************/
/*****************************************************************************/
static void Ctr_GetDataOfCentreFromRow (struct Centre *Ctr,MYSQL_ROW row)
static void Ctr_GetDataOfCentreFromRow (struct Ctr_Centre *Ctr,MYSQL_ROW row)
{
/***** Get centre code (row[0]) *****/
if ((Ctr->CtrCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
@ -822,7 +822,7 @@ long Ctr_GetInsCodOfCentreByCod (long CtrCod)
/*************** Get the short name of a centre from its code ****************/
/*****************************************************************************/
void Ctr_GetShortNameOfCentreByCod (struct Centre *Ctr)
void Ctr_GetShortNameOfCentreByCod (struct Ctr_Centre *Ctr)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -937,7 +937,7 @@ static void Ctr_ListCentresForEdition (const struct Plc_Places *Places)
extern const char *Txt_Another_place;
extern const char *Txt_CENTRE_STATUS[Ctr_NUM_STATUS_TXT];
unsigned NumCtr;
struct Centre *Ctr;
struct Ctr_Centre *Ctr;
unsigned NumPlc;
char WWW[Cns_MAX_BYTES_WWW + 1];
struct UsrData UsrDat;
@ -1135,7 +1135,7 @@ static void Ctr_ListCentresForEdition (const struct Plc_Places *Places)
/************** Check if I can edit, remove, etc. a centre *******************/
/*****************************************************************************/
static bool Ctr_CheckIfICanEditACentre (struct Centre *Ctr)
static bool Ctr_CheckIfICanEditACentre (struct Ctr_Centre *Ctr)
{
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM || // I am an institution administrator or higher
((Ctr->Status & Ctr_STATUS_BIT_PENDING) != 0 && // Centre is not yet activated
@ -1361,7 +1361,7 @@ void Ctr_RenameCentreFull (void)
/************************ Change the name of a centre ************************/
/*****************************************************************************/
void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName)
void Ctr_RenameCentre (struct Ctr_Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName)
{
extern const char *Txt_The_centre_X_already_exists;
extern const char *Txt_The_centre_X_has_been_renamed_as_Y;
@ -2224,7 +2224,7 @@ void Ctr_ListCtrsFound (MYSQL_RES **mysql_res,unsigned NumCtrs)
extern const char *Txt_centres;
MYSQL_ROW row;
unsigned NumCtr;
struct Centre Ctr;
struct Ctr_Centre Ctr;
/***** Query database *****/
if (NumCtrs)
@ -2278,7 +2278,7 @@ static void Ctr_EditingCentreConstructor (void)
Lay_ShowErrorAndExit ("Error initializing centre.");
/***** Allocate memory for centre *****/
if ((Ctr_EditingCtr = (struct Centre *) malloc (sizeof (struct Centre))) == NULL)
if ((Ctr_EditingCtr = (struct Ctr_Centre *) malloc (sizeof (struct Ctr_Centre))) == NULL)
Lay_ShowErrorAndExit ("Error allocating memory for centre.");
/***** Reset centre *****/
@ -2306,7 +2306,7 @@ static void Ctr_EditingCentreDestructor (void)
/************************ Form to go to centre map ***************************/
/*****************************************************************************/
static void Ctr_FormToGoToMap (struct Centre *Ctr)
static void Ctr_FormToGoToMap (struct Ctr_Centre *Ctr)
{
extern const char *Txt_Map;
@ -2324,7 +2324,7 @@ static void Ctr_FormToGoToMap (struct Centre *Ctr)
/************************ Check if a centre has map **************************/
/*****************************************************************************/
bool Ctr_GetIfMapIsAvailable (const struct Centre *Ctr)
bool Ctr_GetIfMapIsAvailable (const struct Ctr_Centre *Ctr)
{
/***** Coordinates 0, 0 means not set ==> don't show map *****/
return (bool) (Ctr->Coord.Latitude ||

View File

@ -60,7 +60,7 @@ typedef enum
#define Ctr_MAX_CENTRES_PER_USR 10 // Used in list of my centres
struct Centre
struct Ctr_Centre
{
long CtrCod; // Centre code
long InsCod; // Institution code
@ -89,7 +89,7 @@ typedef enum
struct ListCentres
{
unsigned Num; // Number of centres
struct Centre *Lst; // List of centres
struct Ctr_Centre *Lst; // List of centres
Ctr_Order_t SelectedOrder; // Order of centres
};
@ -99,7 +99,7 @@ struct ListCentres
void Ctr_SeeCtrWithPendingDegs (void);
void Ctr_DrawCentreLogoAndNameWithLink (struct Centre *Ctr,Act_Action_t Action,
void Ctr_DrawCentreLogoAndNameWithLink (struct Ctr_Centre *Ctr,Act_Action_t Action,
const char *ClassLink,const char *ClassLogo);
void Ctr_ShowCtrsOfCurrentIns (void);
@ -109,9 +109,9 @@ void Ctr_PutIconToViewCentres (void);
void Ctr_GetBasicListOfCentres (long InsCod);
void Ctr_GetFullListOfCentres (long InsCod);
bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr);
bool Ctr_GetDataOfCentreByCod (struct Ctr_Centre *Ctr);
long Ctr_GetInsCodOfCentreByCod (long CtrCod);
void Ctr_GetShortNameOfCentreByCod (struct Centre *Ctr);
void Ctr_GetShortNameOfCentreByCod (struct Ctr_Centre *Ctr);
void Ctr_FreeListCentres (void);
void Ctr_WriteSelectorOfCentre (void);
void Ctr_PutParamCtrCod (long CtrCod);
@ -121,7 +121,7 @@ void Ctr_ChangeCtrPlc (void);
void Ctr_UpdateCtrPlcDB (long CtrCod,long NewPlcCod);
void Ctr_RenameCentreShort (void);
void Ctr_RenameCentreFull (void);
void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName);
void Ctr_RenameCentre (struct Ctr_Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName);
bool Ctr_CheckIfCtrNameExistsInIns (const char *FieldName,const char *Name,
long CtrCod,long InsCod);
void Ctr_ChangeCtrWWW (void);
@ -156,6 +156,6 @@ unsigned Ctr_GetCachedNumCtrsWithUsrs (Rol_Role_t Role,const char *SubQuery,
void Ctr_ListCtrsFound (MYSQL_RES **mysql_res,unsigned NumCtrs);
bool Ctr_GetIfMapIsAvailable (const struct Centre *Ctr);
bool Ctr_GetIfMapIsAvailable (const struct Ctr_Centre *Ctr);
#endif

View File

@ -1027,7 +1027,7 @@ void CtrCfg_ChangeCtrIns (void)
{
extern const char *Txt_The_centre_X_already_exists;
extern const char *Txt_The_centre_X_has_been_moved_to_the_institution_Y;
struct Instit NewIns;
struct Ins_Instit NewIns;
/***** Get parameter with institution code *****/
NewIns.InsCod = Ins_GetAndCheckParamOtherInsCod (1);

View File

@ -553,7 +553,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 20.22 (2021-02-10)"
#define Log_PLATFORM_VERSION "SWAD 20.23 (2021-02-11)"
#define CSS_FILE "swad20.8.css"
#define JS_FILE "swad20.6.2.js"
/*
@ -601,6 +601,7 @@ TODO: DNI de un estudiante sale err
TODO: BUG: Cuando un tipo de grupo sólo tiene un grupo, inscribirse es voluntario, el estudiante sólo puede pertenecer a un grupo, y se inscribe en él, debería poder desapuntarse. Ahora no puede.
TODO: Salvador Romero Cortés: @acanas opción para editar posts
Version 20.23: Feb 11, 2021 New modules swad_timeline_comment and swad_timeline_note. (305319 lines)
Version 20.22: Feb 10, 2021 Code refactoring in timeline. (305137 lines)
Version 20.21.4: Feb 10, 2021 Code refactoring in timeline. (305136 lines)
Version 20.21.3: Feb 10, 2021 Code refactoring in timeline. (305122 lines)

View File

@ -110,8 +110,8 @@ void Cht_ShowListOfAvailableChatRooms (void)
extern const char *Txt_Course;
bool IsLastItemInLevel[1 + Cht_CHAT_MAX_LEVELS];
unsigned NumMyDeg;
struct Degree Deg;
struct Course Crs;
struct Deg_Degree Deg;
struct Crs_Course Crs;
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned long NumRow;
@ -400,8 +400,8 @@ void Cht_OpenChatWindow (void)
char UsrName[Usr_MAX_BYTES_FULL_NAME + 1];
unsigned NumMyDeg;
unsigned NumMyCrs;
struct Degree Deg;
struct Course Crs;
struct Deg_Degree Deg;
struct Crs_Course Crs;
char ThisRoomCode[Cht_MAX_BYTES_ROOM_CODE + 1];
char ThisRoomShortName[Cht_MAX_BYTES_ROOM_SHRT_NAME + 1];
char ThisRoomFullName [Cht_MAX_BYTES_ROOM_FULL_NAME + 1];

View File

@ -274,8 +274,8 @@ static void CtyCfg_Map (void)
unsigned Zoom;
unsigned NumCtrs;
unsigned NumCtr;
struct Centre Ctr;
struct Instit Ins;
struct Ctr_Centre Ctr;
struct Ins_Instit Ins;
/***** Leaflet CSS *****/
Map_LeafletCSS ();

View File

@ -70,7 +70,7 @@ extern struct Globals Gbl;
/**************************** Private variables ******************************/
/*****************************************************************************/
static struct Course *Crs_EditingCrs = NULL; // Static variable to keep the course being edited
static struct Crs_Course *Crs_EditingCrs = NULL; // Static variable to keep the course being edited
/*****************************************************************************/
/**************************** Private prototypes *****************************/
@ -90,17 +90,17 @@ static void Crs_PutIconsEditingCourses (__attribute__((unused)) void *Args);
static void Crs_PutIconToViewCourses (void);
static void Crs_ListCoursesForEdition (void);
static void Crs_ListCoursesOfAYearForEdition (unsigned Year);
static bool Crs_CheckIfICanEdit (struct Course *Crs);
static bool Crs_CheckIfICanEdit (struct Crs_Course *Crs);
static Crs_StatusTxt_t Crs_GetStatusTxtFromStatusBits (Crs_Status_t Status);
static Crs_Status_t Crs_GetStatusBitsFromStatusTxt (Crs_StatusTxt_t StatusTxt);
static void Crs_PutFormToCreateCourse (void);
static void Crs_PutHeadCoursesForSeeing (void);
static void Crs_PutHeadCoursesForEdition (void);
static void Crs_ReceiveFormRequestOrCreateCrs (unsigned Status);
static void Crs_GetParamsNewCourse (struct Course *Crs);
static void Crs_GetParamsNewCourse (struct Crs_Course *Crs);
static void Crs_CreateCourse (unsigned Status);
static void Crs_GetDataOfCourseFromRow (struct Course *Crs,MYSQL_ROW row);
static void Crs_GetDataOfCourseFromRow (struct Crs_Course *Crs,MYSQL_ROW row);
static void Crs_GetShortNamesByCod (long CrsCod,
char CrsShortName[Hie_MAX_BYTES_SHRT_NAME + 1],
@ -155,10 +155,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
extern const char *Txt_My_courses;
extern const char *Txt_System;
struct Country Cty;
struct Instit Ins;
struct Centre Ctr;
struct Degree Deg;
struct Course Crs;
struct Ins_Instit Ins;
struct Ctr_Centre Ctr;
struct Deg_Degree Deg;
struct Crs_Course Crs;
bool IsLastItemInLevel[1 + 5];
bool Highlight; // Highlight because degree, course, etc. is selected
MYSQL_RES *mysql_resCty;
@ -750,7 +750,7 @@ static void Crs_GetListCrssInCurrentDeg (Crs_WhatCourses_t WhatCourses)
MYSQL_ROW row;
unsigned NumCrss;
unsigned NumCrs;
struct Course *Crs;
struct Crs_Course *Crs;
/***** Get courses of a degree from database *****/
switch (WhatCourses)
@ -778,8 +778,8 @@ static void Crs_GetListCrssInCurrentDeg (Crs_WhatCourses_t WhatCourses)
if (NumCrss) // Courses found...
{
/***** Create list with courses in degree *****/
if ((Gbl.Hierarchy.Crss.Lst = (struct Course *) calloc ((size_t) NumCrss,
sizeof (struct Course))) == NULL)
if ((Gbl.Hierarchy.Crss.Lst = (struct Crs_Course *) calloc ((size_t) NumCrss,
sizeof (struct Crs_Course))) == NULL)
Lay_NotEnoughMemoryExit ();
/***** Get the courses in degree *****/
@ -985,7 +985,7 @@ static bool Crs_ListCoursesOfAYearForSeeing (unsigned Year)
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
extern const char *Txt_COURSE_STATUS[Crs_NUM_STATUS_TXT];
unsigned NumCrs;
struct Course *Crs;
struct Crs_Course *Crs;
const char *TxtClassNormal;
const char *TxtClassStrong;
const char *BgColor;
@ -1195,7 +1195,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
{
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
extern const char *Txt_COURSE_STATUS[Crs_NUM_STATUS_TXT];
struct Course *Crs;
struct Crs_Course *Crs;
unsigned YearAux;
unsigned NumCrs;
struct UsrData UsrDat;
@ -1364,7 +1364,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
/************** Check if I can edit, remove, etc. a course *******************/
/*****************************************************************************/
static bool Crs_CheckIfICanEdit (struct Course *Crs)
static bool Crs_CheckIfICanEdit (struct Crs_Course *Crs)
{
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM || // I am a degree administrator or higher
((Crs->Status & Crs_STATUS_BIT_PENDING) != 0 && // Course is not yet activated
@ -1655,7 +1655,7 @@ static void Crs_ReceiveFormRequestOrCreateCrs (unsigned Status)
/************** Get the parameters of a new course from form *****************/
/*****************************************************************************/
static void Crs_GetParamsNewCourse (struct Course *Crs)
static void Crs_GetParamsNewCourse (struct Crs_Course *Crs)
{
char YearStr[2 + 1];
@ -1744,7 +1744,7 @@ void Crs_RemoveCourse (void)
/********************* Get data of a course from its code ********************/
/*****************************************************************************/
bool Crs_GetDataOfCourseByCod (struct Course *Crs)
bool Crs_GetDataOfCourseByCod (struct Crs_Course *Crs)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -1793,7 +1793,7 @@ bool Crs_GetDataOfCourseByCod (struct Course *Crs)
/********** Get data of a course from a row resulting of a query *************/
/*****************************************************************************/
static void Crs_GetDataOfCourseFromRow (struct Course *Crs,MYSQL_ROW row)
static void Crs_GetDataOfCourseFromRow (struct Crs_Course *Crs,MYSQL_ROW row)
{
/***** Get course code (row[0]) *****/
if ((Crs->CrsCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
@ -1893,7 +1893,7 @@ void Crs_RemoveCourseCompletely (long CrsCod)
static void Crs_EmptyCourseCompletely (long CrsCod)
{
struct Course Crs;
struct Crs_Course Crs;
char PathRelCrs[PATH_MAX + 1];
if (CrsCod > 0)
@ -2148,7 +2148,7 @@ void Crs_ChangeCrsYear (void)
/****************** Change the year/semester of a course *********************/
/*****************************************************************************/
void Crs_UpdateCrsYear (struct Course *Crs,unsigned NewYear)
void Crs_UpdateCrsYear (struct Crs_Course *Crs,unsigned NewYear)
{
/***** Update year/semester in table of courses *****/
DB_QueryUPDATE ("can not update the year of a course",
@ -2163,7 +2163,7 @@ void Crs_UpdateCrsYear (struct Course *Crs,unsigned NewYear)
/************* Change the institutional course code of a course **************/
/*****************************************************************************/
void Crs_UpdateInstitutionalCrsCod (struct Course *Crs,const char *NewInstitutionalCrsCod)
void Crs_UpdateInstitutionalCrsCod (struct Crs_Course *Crs,const char *NewInstitutionalCrsCod)
{
/***** Update institutional course code in table of courses *****/
DB_QueryUPDATE ("can not update the institutional code"
@ -2204,7 +2204,7 @@ void Crs_RenameCourseFull (void)
/************************ Change the name of a course ************************/
/*****************************************************************************/
void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFullName)
void Crs_RenameCourse (struct Crs_Course *Crs,Cns_ShrtOrFullName_t ShrtOrFullName)
{
extern const char *Txt_The_course_X_already_exists;
extern const char *Txt_The_name_of_the_course_X_has_changed_to_Y;
@ -2722,7 +2722,7 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA
extern const char *Txt_Enrolment_confirmed;
extern const char *Txt_Enrolment_not_confirmed;
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
struct Degree Deg;
struct Deg_Degree Deg;
long CrsCod;
unsigned NumStds;
unsigned NumNETs;
@ -2990,7 +2990,7 @@ static void Crs_EditingCourseConstructor (void)
Lay_ShowErrorAndExit ("Error initializing course.");
/***** Allocate memory for course *****/
if ((Crs_EditingCrs = (struct Course *) malloc (sizeof (struct Course))) == NULL)
if ((Crs_EditingCrs = (struct Crs_Course *) malloc (sizeof (struct Crs_Course))) == NULL)
Lay_ShowErrorAndExit ("Error allocating memory for course.");
/***** Reset course *****/

View File

@ -75,7 +75,7 @@ typedef enum
Crs_ALL_COURSES_EXCEPT_REMOVED = 1, // Courses with Status bit Crs_STATUS_BIT_REMOVED == 0
} Crs_WhatCourses_t;
struct Course
struct Crs_Course
{
long CrsCod;
char InstitutionalCrsCod[Crs_MAX_BYTES_INSTITUTIONAL_CRS_COD + 1]; // Institutional code of the course
@ -90,7 +90,7 @@ struct Course
struct ListCourses
{
unsigned Num; // Number of courses
struct Course *Lst; // List of courses
struct Crs_Course *Lst; // List of courses
};
/*****************************************************************************/
@ -131,15 +131,15 @@ void Crs_ReceiveFormReqCrs (void);
void Crs_ReceiveFormNewCrs (void);
void Crs_RemoveCourse (void);
bool Crs_GetDataOfCourseByCod (struct Course *Crs);
bool Crs_GetDataOfCourseByCod (struct Crs_Course *Crs);
void Crs_RemoveCourseCompletely (long CrsCod);
void Crs_ChangeInsCrsCod (void);
void Crs_ChangeCrsYear (void);
void Crs_UpdateCrsYear (struct Course *Crs,unsigned NewYear);
void Crs_UpdateInstitutionalCrsCod (struct Course *Crs,const char *NewInstitutionalCrsCod);
void Crs_UpdateCrsYear (struct Crs_Course *Crs,unsigned NewYear);
void Crs_UpdateInstitutionalCrsCod (struct Crs_Course *Crs,const char *NewInstitutionalCrsCod);
void Crs_RenameCourseShort (void);
void Crs_RenameCourseFull (void);
void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFullName);
void Crs_RenameCourse (struct Crs_Course *Crs,Cns_ShrtOrFullName_t ShrtOrFullName);
bool Crs_CheckIfCrsNameExistsInYearOfDeg (const char *FieldName,const char *Name,long CrsCod,
long DegCod,unsigned Year);
void Crs_ChangeCrsStatus (void);

View File

@ -467,7 +467,7 @@ void CrsCfg_ChangeCrsDeg (void)
extern const char *Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z;
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
extern const char *Txt_The_course_X_has_been_moved_to_the_degree_Y;
struct Degree NewDeg;
struct Deg_Degree NewDeg;
/***** Get parameter with degree code *****/
NewDeg.DegCod = Deg_GetAndCheckParamOtherDegCod (1);

View File

@ -67,14 +67,14 @@ typedef enum
/**************************** Private variables ******************************/
/*****************************************************************************/
static struct Degree *Deg_EditingDeg = NULL; // Static variable to keep the degree being edited
static struct Deg_Degree *Deg_EditingDeg = NULL; // Static variable to keep the degree being edited
/*****************************************************************************/
/**************************** Private prototypes *****************************/
/*****************************************************************************/
static void Deg_ListDegreesForEdition (void);
static bool Deg_CheckIfICanEditADegree (struct Degree *Deg);
static bool Deg_CheckIfICanEditADegree (struct Deg_Degree *Deg);
static Deg_StatusTxt_t Deg_GetStatusTxtFromStatusBits (Deg_Status_t Status);
static Deg_Status_t Deg_GetStatusBitsFromStatusTxt (Deg_StatusTxt_t StatusTxt);
static void Deg_PutFormToCreateDegree (void);
@ -86,7 +86,7 @@ static void Deg_ListDegrees (void);
static bool Deg_CheckIfICanCreateDegrees (void);
static void Deg_PutIconsListingDegrees (__attribute__((unused)) void *Args);
static void Deg_PutIconToEditDegrees (void);
static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg);
static void Deg_ListOneDegreeForSeeing (struct Deg_Degree *Deg,unsigned NumDeg);
static void Deg_EditDegreesInternal (void);
static void Deg_PutIconsEditingDegrees (__attribute__((unused)) void *Args);
@ -94,7 +94,7 @@ static void Deg_PutIconsEditingDegrees (__attribute__((unused)) void *Args);
static void Deg_ReceiveFormRequestOrCreateDeg (unsigned Status);
static void Deg_PutParamOtherDegCod (void *DegCod);
static void Deg_GetDataOfDegreeFromRow (struct Degree *Deg,MYSQL_ROW row);
static void Deg_GetDataOfDegreeFromRow (struct Deg_Degree *Deg,MYSQL_ROW row);
static void Deg_UpdateDegNameDB (long DegCod,const char *FieldName,const char *NewDegName);
@ -119,7 +119,7 @@ void Deg_SeeDegWithPendingCrss (void)
MYSQL_ROW row;
unsigned NumDegs;
unsigned NumDeg;
struct Degree Deg;
struct Deg_Degree Deg;
const char *BgColor;
/***** Get degrees with pending courses *****/
@ -217,7 +217,7 @@ void Deg_SeeDegWithPendingCrss (void)
/******************** Draw degree logo and name with link ********************/
/*****************************************************************************/
void Deg_DrawDegreeLogoAndNameWithLink (struct Degree *Deg,Act_Action_t Action,
void Deg_DrawDegreeLogoAndNameWithLink (struct Deg_Degree *Deg,Act_Action_t Action,
const char *ClassLink,const char *ClassLogo)
{
/***** Begin form *****/
@ -338,7 +338,7 @@ static void Deg_ListDegreesForEdition (void)
extern const char *Txt_DEGREE_STATUS[Deg_NUM_STATUS_TXT];
unsigned NumDeg;
struct DegreeType *DegTyp;
struct Degree *Deg;
struct Deg_Degree *Deg;
unsigned NumDegTyp;
char WWW[Cns_MAX_BYTES_WWW + 1];
struct UsrData UsrDat;
@ -527,7 +527,7 @@ static void Deg_ListDegreesForEdition (void)
/************** Check if I can edit, remove, etc. a degree *******************/
/*****************************************************************************/
static bool Deg_CheckIfICanEditADegree (struct Degree *Deg)
static bool Deg_CheckIfICanEditADegree (struct Deg_Degree *Deg)
{
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM || // I am a centre administrator or higher
((Deg->Status & Deg_STATUS_BIT_PENDING) != 0 && // Degree is not yet activated
@ -875,7 +875,7 @@ static void Deg_PutIconToEditDegrees (void)
/************************ List one degree for seeing *************************/
/*****************************************************************************/
static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg)
static void Deg_ListOneDegreeForSeeing (struct Deg_Degree *Deg,unsigned NumDeg)
{
extern const char *Txt_DEGREE_With_courses;
extern const char *Txt_DEGREE_Without_courses;
@ -1080,7 +1080,7 @@ void Deg_GetListAllDegsWithStds (struct ListDegrees *Degs)
if (Degs->Num) // Degrees found...
{
/***** Create list with degrees *****/
if ((Degs->Lst = (struct Degree *) calloc (Degs->Num,sizeof (struct Degree))) == NULL)
if ((Degs->Lst = (struct Deg_Degree *) calloc (Degs->Num,sizeof (struct Deg_Degree))) == NULL)
Lay_NotEnoughMemoryExit ();
/***** Get the degrees *****/
@ -1110,7 +1110,7 @@ void Deg_GetListDegsInCurrentCtr (void)
MYSQL_ROW row;
unsigned long NumRows;
unsigned NumDeg;
struct Degree *Deg;
struct Deg_Degree *Deg;
/***** Get degrees of the current centre from database *****/
NumRows = DB_QuerySELECT (&mysql_res,"can not get degrees of a centre",
@ -1125,8 +1125,8 @@ void Deg_GetListDegsInCurrentCtr (void)
Gbl.Hierarchy.Degs.Num = (unsigned) NumRows;
/***** Create list with degrees of this centre *****/
if ((Gbl.Hierarchy.Degs.Lst = (struct Degree *) calloc (Gbl.Hierarchy.Degs.Num,
sizeof (struct Degree))) == NULL)
if ((Gbl.Hierarchy.Degs.Lst = (struct Deg_Degree *) calloc (Gbl.Hierarchy.Degs.Num,
sizeof (struct Deg_Degree))) == NULL)
Lay_NotEnoughMemoryExit ();
/***** Get the degrees of this centre *****/
@ -1323,7 +1323,7 @@ long Deg_GetAndCheckParamOtherDegCod (long MinCodAllowed)
/*****************************************************************************/
// Returns true if degree found
bool Deg_GetDataOfDegreeByCod (struct Degree *Deg)
bool Deg_GetDataOfDegreeByCod (struct Deg_Degree *Deg)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -1367,7 +1367,7 @@ bool Deg_GetDataOfDegreeByCod (struct Degree *Deg)
/********** Get data of a degree from a row resulting of a query *************/
/*****************************************************************************/
static void Deg_GetDataOfDegreeFromRow (struct Degree *Deg,MYSQL_ROW row)
static void Deg_GetDataOfDegreeFromRow (struct Deg_Degree *Deg,MYSQL_ROW row)
{
/***** Get degree code (row[0]) *****/
if ((Deg->DegCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
@ -1403,7 +1403,7 @@ static void Deg_GetDataOfDegreeFromRow (struct Degree *Deg,MYSQL_ROW row)
/************* Get the short name of a degree from its code ******************/
/*****************************************************************************/
void Deg_GetShortNameOfDegreeByCod (struct Degree *Deg)
void Deg_GetShortNameOfDegreeByCod (struct Deg_Degree *Deg)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -1588,7 +1588,7 @@ void Deg_RenameDegreeFull (void)
/************************ Change the name of a degree ************************/
/*****************************************************************************/
void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFullName)
void Deg_RenameDegree (struct Deg_Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFullName)
{
extern const char *Txt_The_degree_X_already_exists;
extern const char *Txt_The_name_of_the_degree_X_has_changed_to_Y;
@ -2124,7 +2124,7 @@ void Deg_ListDegsFound (MYSQL_RES **mysql_res,unsigned NumDegs)
extern const char *Txt_degrees;
MYSQL_ROW row;
unsigned NumDeg;
struct Degree Deg;
struct Deg_Degree Deg;
/***** Query database *****/
if (NumDegs)
@ -2178,7 +2178,7 @@ static void Deg_EditingDegreeConstructor (void)
Lay_ShowErrorAndExit ("Error initializing degree.");
/***** Allocate memory for degree *****/
if ((Deg_EditingDeg = (struct Degree *) malloc (sizeof (struct Degree))) == NULL)
if ((Deg_EditingDeg = (struct Deg_Degree *) malloc (sizeof (struct Deg_Degree))) == NULL)
Lay_ShowErrorAndExit ("Error allocating memory for degree.");
/***** Reset degree *****/

View File

@ -66,7 +66,7 @@ typedef enum
Deg_STATUS_REMOVED = 3, // 1- (Status & Deg_STATUS_BIT_REMOVED)
} Deg_StatusTxt_t;
struct Degree
struct Deg_Degree
{
long DegCod; // Degree code
long DegTypCod; // Degree type code
@ -81,7 +81,7 @@ struct Degree
struct ListDegrees
{
unsigned Num; // Number of degrees
struct Degree *Lst; // List of degrees
struct Deg_Degree *Lst; // List of degrees
};
/*****************************************************************************/
@ -90,7 +90,7 @@ struct ListDegrees
void Deg_SeeDegWithPendingCrss (void);
void Deg_DrawDegreeLogoAndNameWithLink (struct Degree *Deg,Act_Action_t Action,
void Deg_DrawDegreeLogoAndNameWithLink (struct Deg_Degree *Deg,Act_Action_t Action,
const char *ClassLink,const char *ClassLogo);
void Deg_WriteSelectorOfDegree (void);
@ -114,14 +114,14 @@ void Deg_RemoveDegree (void);
void Deg_PutParamDegCod (long DegCod);
long Deg_GetAndCheckParamOtherDegCod (long MinCodAllowed);
bool Deg_GetDataOfDegreeByCod (struct Degree *Deg);
void Deg_GetShortNameOfDegreeByCod (struct Degree *Deg);
bool Deg_GetDataOfDegreeByCod (struct Deg_Degree *Deg);
void Deg_GetShortNameOfDegreeByCod (struct Deg_Degree *Deg);
long Deg_GetCtrCodOfDegreeByCod (long DegCod);
long Deg_GetInsCodOfDegreeByCod (long DegCod);
void Deg_RemoveDegreeCompletely (long DegCod);
void Deg_RenameDegreeShort (void);
void Deg_RenameDegreeFull (void);
void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFullName);
void Deg_RenameDegree (struct Deg_Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFullName);
bool Deg_CheckIfDegNameExistsInCtr (const char *FieldName,const char *Name,
long DegCod,long CtrCod);
void Deg_ChangeDegreeType (void);

View File

@ -356,7 +356,7 @@ void DegCfg_ChangeDegCtr (void)
{
extern const char *Txt_The_degree_X_already_exists;
extern const char *Txt_The_degree_X_has_been_moved_to_the_centre_Y;
struct Centre NewCtr;
struct Ctr_Centre NewCtr;
/***** Get parameter with centre code *****/
NewCtr.CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);

View File

@ -530,7 +530,7 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
extern const char *Txt_Another_institution;
unsigned NumDpt;
struct Dpt_Department *Dpt;
struct Instit Ins;
struct Ins_Instit Ins;
unsigned NumIns;
/***** Begin table *****/

View File

@ -172,7 +172,7 @@ static void Enr_ReqRemOrRemAdm (Enr_ReqDelOrDelUsr_t ReqDelOrDelUsr,Hie_Level_t
static void Enr_ReqAddAdm (Hie_Level_t Scope,long Cod,const char *InsCtrDegName);
static void Enr_AskIfRemoveUsrFromCrs (struct UsrData *UsrDat);
static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,
struct Course *Crs,
struct Crs_Course *Crs,
Enr_RemoveUsrProduction_t RemoveUsrWorks,
Cns_QuietOrVerbose_t QuietOrVerbose);
@ -1907,7 +1907,7 @@ void Enr_RemAllStdsThisCrs (void)
/*****************************************************************************/
// Returns the numbers of students in the course before deletion
unsigned Enr_RemAllStdsInCrs (struct Course *Crs)
unsigned Enr_RemAllStdsInCrs (struct Crs_Course *Crs)
{
unsigned NumStdsInCrs;
unsigned NumUsr;
@ -2257,8 +2257,8 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected)
unsigned long NumReqs = 0; // Initialized to avoid warning
unsigned long NumReq;
long ReqCod;
struct Degree Deg;
struct Course Crs;
struct Deg_Degree Deg;
struct Crs_Course Crs;
struct UsrData UsrDat;
bool UsrExists;
bool UsrBelongsToCrs;
@ -4094,7 +4094,7 @@ static void Enr_AskIfRemoveUsrFromCrs (struct UsrData *UsrDat)
/*****************************************************************************/
static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,
struct Course *Crs,
struct Crs_Course *Crs,
Enr_RemoveUsrProduction_t RemoveUsrWorks,
Cns_QuietOrVerbose_t QuietOrVerbose)
{

View File

@ -106,7 +106,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe);
void Enr_PutLinkToAdminSeveralUsrs (Rol_Role_t Role);
void Enr_AskRemAllStdsThisCrs (void);
void Enr_RemAllStdsThisCrs (void);
unsigned Enr_RemAllStdsInCrs (struct Course *Crs);
unsigned Enr_RemAllStdsInCrs (struct Crs_Course *Crs);
void Enr_ReqSignUpInCrs (void);
void Enr_SignUpInCrs (void);
void Enr_GetNotifEnrolmentRequest (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],

View File

@ -45,6 +45,7 @@
#include "swad_RSS.h"
#include "swad_string.h"
#include "swad_timeline.h"
#include "swad_timeline_note.h"
/*****************************************************************************/
/************** External global variables from others modules ****************/
@ -378,7 +379,7 @@ void ExaAnn_ReceiveExamAnn2 (void)
ExaAnn_UpdateNumUsrsNotifiedByEMailAboutExamAnn (ExamAnns->HighlightExaCod,NumUsrsToBeNotifiedByEMail);
/***** Create a new social note about the new exam announcement *****/
TL_StoreAndPublishNote (TL_NOTE_EXAM_ANNOUNCEMENT,ExamAnns->HighlightExaCod);
TL_Not_StoreAndPublishNote (TL_NOTE_EXAM_ANNOUNCEMENT,ExamAnns->HighlightExaCod);
/***** Update RSS of current course *****/
RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs);
@ -496,7 +497,7 @@ void ExaAnn_RemoveExamAnn1 (void)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_EXAM_ANNOUNCEMENT,ExaCod);
/***** Mark possible social note as unavailable *****/
TL_MarkNoteAsUnavailable (TL_NOTE_EXAM_ANNOUNCEMENT,ExaCod);
TL_Not_MarkNoteAsUnavailable (TL_NOTE_EXAM_ANNOUNCEMENT,ExaCod);
/***** Update RSS of current course *****/
RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs);
@ -1085,7 +1086,7 @@ static void ExaAnn_ShowExamAnn (struct ExaAnn_ExamAnnouncements *ExamAnns,
extern const char *Txt_minute;
extern const char *Txt_minutes;
extern const char *Txt_Publish_announcement_OF_EXAM;
struct Instit Ins;
struct Ins_Instit Ins;
char StrExamDate[Cns_MAX_BYTES_DATE + 1];
unsigned Year;
unsigned Hour;
@ -1761,9 +1762,9 @@ static void ExaAnn_GetNotifContentExamAnn (const struct ExaAnn_ExamAnnouncements
extern const char *Txt_EXAM_ANNOUNCEMENT_Material_allowed;
extern const char *Txt_EXAM_ANNOUNCEMENT_Other_information;
extern const char *Txt_hours_ABBREVIATION;
struct Course Crs;
struct Degree Deg;
struct Instit Ins;
struct Crs_Course Crs;
struct Deg_Degree Deg;
struct Ins_Instit Ins;
char StrExamDate[Cns_MAX_BYTES_DATE + 1];
/***** Get data of course *****/

View File

@ -55,6 +55,7 @@
#include "swad_survey.h"
#include "swad_test.h"
#include "swad_timeline.h"
#include "swad_timeline_note.h"
/*****************************************************************************/
/************** External global variables from others modules ****************/
@ -127,7 +128,7 @@ static void Fig_GetAndShowInssOrderedByNumUsrsInCrss (void);
static void Fig_GetAndShowInssOrderedByNumUsrsWhoClaimToBelongToThem (void);
static void Fig_ShowInss (MYSQL_RES **mysql_res,unsigned NumInss,
const char *TxtFigure);
static unsigned Fig_GetInsAndStat (struct Instit *Ins,MYSQL_RES *mysql_res);
static unsigned Fig_GetInsAndStat (struct Ins_Instit *Ins,MYSQL_RES *mysql_res);
static void Fig_GetAndShowDegreeTypesStats (void);
@ -1415,7 +1416,7 @@ static void Fig_ShowInss (MYSQL_RES **mysql_res,unsigned NumInss,
unsigned NumOrder;
unsigned NumberLastRow;
unsigned NumberThisRow;
struct Instit Ins;
struct Ins_Instit Ins;
bool TRIsOpen = false;
/***** Query database *****/
@ -1520,7 +1521,7 @@ static void Fig_ShowInss (MYSQL_RES **mysql_res,unsigned NumInss,
/******************** Get institution data and statistic *********************/
/*****************************************************************************/
static unsigned Fig_GetInsAndStat (struct Instit *Ins,MYSQL_RES *mysql_res)
static unsigned Fig_GetInsAndStat (struct Ins_Instit *Ins,MYSQL_RES *mysql_res)
{
MYSQL_ROW row;
unsigned NumberThisRow;
@ -3392,11 +3393,11 @@ static void Fig_GetAndShowTimelineActivityStats (void)
extern const char *Txt_Number_of_users;
extern const char *Txt_PERCENT_of_users;
extern const char *Txt_Number_of_posts_BR_per_user;
extern const char *Txt_TIMELINE_NOTE[TL_NUM_NOTE_TYPES];
extern const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES];
extern const char *Txt_Total;
MYSQL_RES *mysql_res;
MYSQL_ROW row;
TL_NoteType_t NoteType;
TL_Not_NoteType_t NoteType;
unsigned long NumNotes;
unsigned long NumRows;
unsigned NumUsrs;
@ -3433,8 +3434,8 @@ static void Fig_GetAndShowTimelineActivityStats (void)
1 << Rol_TCH);
/***** Get total number of following/followers from database *****/
for (NoteType = (TL_NoteType_t) 0;
NoteType <= (TL_NoteType_t) (TL_NUM_NOTE_TYPES - 1);
for (NoteType = (TL_Not_NoteType_t) 0;
NoteType <= (TL_Not_NoteType_t) (TL_NOT_NUM_NOTE_TYPES - 1);
NoteType++)
{
switch (Gbl.Scope.Current)

View File

@ -59,6 +59,7 @@
#include "swad_role.h"
#include "swad_string.h"
#include "swad_timeline.h"
#include "swad_timeline_note.h"
#include "swad_zip.h"
/*****************************************************************************/
@ -6846,10 +6847,10 @@ static void Brw_WriteCurrentClipboard (void)
extern const char *Txt_folder;
extern const char *Txt_link;
extern const char *Txt_all_files_inside_the_root_folder;
struct Instit Ins;
struct Centre Ctr;
struct Degree Deg;
struct Course Crs;
struct Ins_Instit Ins;
struct Ctr_Centre Ctr;
struct Deg_Degree Deg;
struct Crs_Course Crs;
struct GroupData GrpDat;
struct Prj_Project Prj;
struct UsrData UsrDat;
@ -7862,10 +7863,10 @@ static void Brw_PasteClipboard (void)
extern const char *Txt_Links_copied;
extern const char *Txt_Folders_copied;
extern const char *Txt_You_can_not_paste_file_or_folder_here;
struct Instit Ins;
struct Centre Ctr;
struct Degree Deg;
struct Course Crs;
struct Ins_Instit Ins;
struct Ctr_Centre Ctr;
struct Deg_Degree Deg;
struct Crs_Course Crs;
struct GroupData GrpDat;
struct UsrData UsrDat;
long PrjCod;
@ -10277,28 +10278,28 @@ void Brw_ChgFileMetadata (void)
switch (Gbl.FileBrowser.Type)
{
case Brw_ADMI_DOC_INS:
TL_StoreAndPublishNote (TL_NOTE_INS_DOC_PUB_FILE,FileMetadata.FilCod);
TL_Not_StoreAndPublishNote (TL_NOTE_INS_DOC_PUB_FILE,FileMetadata.FilCod);
break;
case Brw_ADMI_SHR_INS:
TL_StoreAndPublishNote (TL_NOTE_INS_SHA_PUB_FILE,FileMetadata.FilCod);
TL_Not_StoreAndPublishNote (TL_NOTE_INS_SHA_PUB_FILE,FileMetadata.FilCod);
break;
case Brw_ADMI_DOC_CTR:
TL_StoreAndPublishNote (TL_NOTE_CTR_DOC_PUB_FILE,FileMetadata.FilCod);
TL_Not_StoreAndPublishNote (TL_NOTE_CTR_DOC_PUB_FILE,FileMetadata.FilCod);
break;
case Brw_ADMI_SHR_CTR:
TL_StoreAndPublishNote (TL_NOTE_CTR_SHA_PUB_FILE,FileMetadata.FilCod);
TL_Not_StoreAndPublishNote (TL_NOTE_CTR_SHA_PUB_FILE,FileMetadata.FilCod);
break;
case Brw_ADMI_DOC_DEG:
TL_StoreAndPublishNote (TL_NOTE_DEG_DOC_PUB_FILE,FileMetadata.FilCod);
TL_Not_StoreAndPublishNote (TL_NOTE_DEG_DOC_PUB_FILE,FileMetadata.FilCod);
break;
case Brw_ADMI_SHR_DEG:
TL_StoreAndPublishNote (TL_NOTE_DEG_SHA_PUB_FILE,FileMetadata.FilCod);
TL_Not_StoreAndPublishNote (TL_NOTE_DEG_SHA_PUB_FILE,FileMetadata.FilCod);
break;
case Brw_ADMI_DOC_CRS:
TL_StoreAndPublishNote (TL_NOTE_CRS_DOC_PUB_FILE,FileMetadata.FilCod);
TL_Not_StoreAndPublishNote (TL_NOTE_CRS_DOC_PUB_FILE,FileMetadata.FilCod);
break;
case Brw_ADMI_SHR_CRS:
TL_StoreAndPublishNote (TL_NOTE_CRS_SHA_PUB_FILE,FileMetadata.FilCod);
TL_Not_StoreAndPublishNote (TL_NOTE_CRS_SHA_PUB_FILE,FileMetadata.FilCod);
break;
default:
break;
@ -11067,9 +11068,9 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
long *CrsCod,
long *GrpCod)
{
struct Centre Ctr;
struct Degree Deg;
struct Course Crs;
struct Ctr_Centre Ctr;
struct Deg_Degree Deg;
struct Crs_Course Crs;
struct GroupData GrpDat;
switch (FileBrowser)
@ -11200,7 +11201,7 @@ static void Brw_RemoveOneFileOrFolderFromDB (const char Path[PATH_MAX + 1])
Set possible social note as unavailable.
Important: do this before removing from files *****/
Ntf_MarkNotifOneFileAsRemoved (Path);
TL_MarkNoteOneFileAsUnavailable (Path);
TL_Not_MarkNoteOneFileAsUnavailable (Path);
/***** Remove from database the entries that store the marks properties *****/
if (FileBrowser == Brw_ADMI_MRK_CRS ||
@ -11244,7 +11245,7 @@ static void Brw_RemoveChildrenOfFolderFromDB (const char Path[PATH_MAX + 1])
Set possible social notes as unavailable.
Important: do this before removing from files *****/
Ntf_MarkNotifChildrenOfFolderAsRemoved (Path);
TL_MarkNotesChildrenOfFolderAsUnavailable (Path);
TL_Not_MarkNotesChildrenOfFolderAsUnavailable (Path);
/***** Remove from database the entries that store the marks properties *****/
if (FileBrowser == Brw_ADMI_MRK_CRS ||
@ -11745,7 +11746,7 @@ void Brw_RemoveGrpZones (long CrsCod,long GrpCod)
/***************** Remove the works of a user in a course ********************/
/*****************************************************************************/
void Brw_RemoveUsrWorksInCrs (struct UsrData *UsrDat,struct Course *Crs)
void Brw_RemoveUsrWorksInCrs (struct UsrData *UsrDat,struct Crs_Course *Crs)
{
char PathUsrInCrs[PATH_MAX + 1];
@ -11772,7 +11773,7 @@ void Brw_RemoveUsrWorksInAllCrss (struct UsrData *UsrDat)
unsigned long NumRows;
unsigned long NumRow;
unsigned NumCrssWorksRemoved = 0;
struct Course Crs;
struct Crs_Course Crs;
/***** Query database *****/
if ((NumRows = Usr_GetCrssFromUsr (UsrDat->UsrCod,-1L,&mysql_res)) > 0) // If courses found

View File

@ -260,7 +260,7 @@ void Brw_PutImplicitParamsFileBrowser (void *FilFolLnk);
void Brw_RemoveZonesOfGroupsOfType (long GrpTypCod);
void Brw_RemoveGrpZones (long CrsCod,long GrpCod);
void Brw_RemoveUsrWorksInCrs (struct UsrData *UsrDat,struct Course *Crs);
void Brw_RemoveUsrWorksInCrs (struct UsrData *UsrDat,struct Crs_Course *Crs);
void Brw_RemoveUsrWorksInAllCrss (struct UsrData *UsrDat);
void Brw_GetSummaryAndContentOfFile (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],

View File

@ -51,6 +51,7 @@
#include "swad_profile.h"
#include "swad_role.h"
#include "swad_timeline.h"
#include "swad_timeline_note.h"
/*****************************************************************************/
/************** External global variables from others modules ****************/
@ -303,7 +304,7 @@ static void For_InsertPstIntoBannedPstTable (long PstCod);
static long For_InsertForumPst (long ThrCod,long UsrCod,
const char *Subject,const char *Content,
struct Media *Media);
struct Med_Media *Media);
static bool For_RemoveForumPst (long PstCod,long MedCod);
static unsigned For_NumPstsInThrWithPstCod (long PstCod,long *ThrCod);
@ -337,7 +338,7 @@ static void For_ShowAForumPost (struct For_Forums *Forums,
static void For_GetPstData (long PstCod,long *UsrCod,time_t *CreatTimeUTC,
char Subject[Cns_MAX_BYTES_SUBJECT + 1],
char Content[Cns_MAX_BYTES_LONG_TEXT + 1],
struct Media *Media);
struct Med_Media *Media);
static void For_WriteNumberOfPosts (const struct For_Forums *Forums,long UsrCod);
static void For_PutParamsForum (void *Forums);
@ -553,7 +554,7 @@ static void For_InsertPstIntoBannedPstTable (long PstCod)
static long For_InsertForumPst (long ThrCod,long UsrCod,
const char *Subject,const char *Content,
struct Media *Media)
struct Med_Media *Media)
{
long PstCod;
@ -1212,7 +1213,7 @@ static void For_ShowAForumPost (struct For_Forums *Forums,
char OriginalContent[Cns_MAX_BYTES_LONG_TEXT + 1];
char Subject[Cns_MAX_BYTES_SUBJECT + 1];
char Content[Cns_MAX_BYTES_LONG_TEXT + 1];
struct Media Media;
struct Med_Media Media;
bool Enabled;
/***** Initialize structure with user's data *****/
@ -1345,7 +1346,7 @@ static void For_ShowAForumPost (struct For_Forums *Forums,
static void For_GetPstData (long PstCod,long *UsrCod,time_t *CreatTimeUTC,
char Subject[Cns_MAX_BYTES_SUBJECT + 1],
char Content[Cns_MAX_BYTES_LONG_TEXT + 1],
struct Media *Media)
struct Med_Media *Media)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -2168,10 +2169,10 @@ void For_SetForumName (const struct For_Forum *Forum,
extern const char *Txt_only_teachers;
extern const char *Txt_only_teachers_NO_HTML[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Unknown_FORUM;
struct Instit Ins;
struct Centre Ctr;
struct Degree Deg;
struct Course Crs;
struct Ins_Instit Ins;
struct Ctr_Centre Ctr;
struct Deg_Degree Deg;
struct Crs_Course Crs;
switch (Forum->Type)
{
@ -3933,7 +3934,7 @@ void For_ReceiveForumPost (void)
unsigned NumUsrsToBeNotifiedByEMail;
char Subject[Cns_MAX_BYTES_SUBJECT + 1];
char Content[Cns_MAX_BYTES_LONG_TEXT + 1];
struct Media Media;
struct Med_Media Media;
/***** Reset forum *****/
For_ResetForums (&Forums);
@ -4021,7 +4022,7 @@ void For_ReceiveForumPost (void)
{
case For_FORUM_GLOBAL_USRS:
case For_FORUM__SWAD__USRS:
TL_StoreAndPublishNote (TL_NOTE_FORUM_POST,PstCod);
TL_Not_StoreAndPublishNote (TL_NOTE_FORUM_POST,PstCod);
break;
default:
break;
@ -4063,7 +4064,7 @@ void For_RemovePost (void)
time_t CreatTimeUTC; // Creation time of a message
char Subject[Cns_MAX_BYTES_SUBJECT + 1];
char OriginalContent[Cns_MAX_BYTES_LONG_TEXT + 1];
struct Media Media;
struct Med_Media Media;
bool ItsMe;
bool ThreadDeleted = false;
@ -4109,7 +4110,7 @@ void For_RemovePost (void)
{
case For_FORUM_GLOBAL_USRS:
case For_FORUM__SWAD__USRS:
TL_MarkNoteAsUnavailable (TL_NOTE_FORUM_POST,Forums.PstCod);
TL_Not_MarkNoteAsUnavailable (TL_NOTE_FORUM_POST,Forums.PstCod);
break;
default:
break;

View File

@ -192,13 +192,13 @@ struct Globals
struct ListCountries Ctys;// List of countries
struct Country Cty; // Current country
struct ListInstits Inss; // List of institutions in current country
struct Instit Ins; // Current institution
struct Ins_Instit Ins; // Current institution
struct ListCentres Ctrs; // List of centres in current institution
struct Centre Ctr; // Current centre
struct Ctr_Centre Ctr; // Current centre
struct ListDegrees Degs; // List of degrees in current centre
struct Degree Deg; // Current degree
struct Deg_Degree Deg; // Current degree
struct ListCourses Crss; // List of courses in current degree
struct Course Crs; // Current course. Aditional info about course is stored in Gbl.Crs.
struct Crs_Course Crs; // Current course. Aditional info about course is stored in Gbl.Crs.
} Hierarchy;
struct
{

View File

@ -659,9 +659,9 @@ void Hie_GetAndWriteInsCtrDegAdminBy (long UsrCod,unsigned ColSpan)
MYSQL_ROW row;
unsigned NumRow;
unsigned NumRows;
struct Instit Ins;
struct Centre Ctr;
struct Degree Deg;
struct Ins_Instit Ins;
struct Ctr_Centre Ctr;
struct Deg_Degree Deg;
/***** Get institutions, centres, degrees admin by user from database *****/
NumRows = (unsigned) DB_QuerySELECT (&mysql_res,"can not get institutions,"

View File

@ -62,7 +62,7 @@ extern struct Globals Gbl;
/***************************** Private variables *****************************/
/*****************************************************************************/
static struct Instit *Ins_EditingIns = NULL; // Static variable to keep the institution being edited
static struct Ins_Instit *Ins_EditingIns = NULL; // Static variable to keep the institution being edited
/*****************************************************************************/
/***************************** Private prototypes ****************************/
@ -72,7 +72,7 @@ static void Ins_ListInstitutions (void);
static bool Ins_CheckIfICanCreateInstitutions (void);
static void Ins_PutIconsListingInstitutions (__attribute__((unused)) void *Args);
static void Ins_PutIconToEditInstitutions (void);
static void Ins_ListOneInstitutionForSeeing (struct Instit *Ins,unsigned NumIns);
static void Ins_ListOneInstitutionForSeeing (struct Ins_Instit *Ins,unsigned NumIns);
static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable);
static void Ins_GetParamInsOrder (void);
@ -80,13 +80,13 @@ static void Ins_EditInstitutionsInternal (void);
static void Ins_PutIconsEditingInstitutions (__attribute__((unused)) void *Args);
static void Ins_PutIconToViewInstitutions (void);
static void Ins_GetDataOfInstitFromRow (struct Instit *Ins,MYSQL_ROW row);
static void Ins_GetDataOfInstitFromRow (struct Ins_Instit *Ins,MYSQL_ROW row);
static void Ins_GetShrtNameAndCtyOfInstitution (struct Instit *Ins,
static void Ins_GetShrtNameAndCtyOfInstitution (struct Ins_Instit *Ins,
char CtyName[Hie_MAX_BYTES_FULL_NAME + 1]);
static void Ins_ListInstitutionsForEdition (void);
static bool Ins_CheckIfICanEdit (struct Instit *Ins);
static bool Ins_CheckIfICanEdit (struct Ins_Instit *Ins);
static Ins_StatusTxt_t Ins_GetStatusTxtFromStatusBits (Ins_Status_t Status);
static Ins_Status_t Ins_GetStatusBitsFromStatusTxt (Ins_StatusTxt_t StatusTxt);
@ -106,7 +106,7 @@ static void Ins_CreateInstitution (unsigned Status);
static void Ins_EditingInstitutionConstructor ();
static void Ins_EditingInstitutionDestructor ();
static void Ins_FormToGoToMap (struct Instit *Ins);
static void Ins_FormToGoToMap (struct Ins_Instit *Ins);
/*****************************************************************************/
/***************** List institutions with pending centres ********************/
@ -123,7 +123,7 @@ void Ins_SeeInsWithPendingCtrs (void)
MYSQL_ROW row;
unsigned NumInss;
unsigned NumIns;
struct Instit Ins;
struct Ins_Instit Ins;
const char *BgColor;
/***** Get institutions with pending centres *****/
@ -220,7 +220,7 @@ void Ins_SeeInsWithPendingCtrs (void)
/********************** Draw institution logo with link **********************/
/*****************************************************************************/
void Ins_DrawInstitutionLogoWithLink (struct Instit *Ins,unsigned Size)
void Ins_DrawInstitutionLogoWithLink (struct Ins_Instit *Ins,unsigned Size)
{
bool PutLink = !Gbl.Form.Inside; // Don't put link to institution if already inside a form
@ -243,7 +243,7 @@ void Ins_DrawInstitutionLogoWithLink (struct Instit *Ins,unsigned Size)
/****************** Draw institution logo and name with link *****************/
/*****************************************************************************/
void Ins_DrawInstitutionLogoAndNameWithLink (struct Instit *Ins,Act_Action_t Action,
void Ins_DrawInstitutionLogoAndNameWithLink (struct Ins_Instit *Ins,Act_Action_t Action,
const char *ClassLink,const char *ClassLogo)
{
/***** Begin form *****/
@ -380,7 +380,7 @@ static void Ins_PutIconToEditInstitutions (void)
/********************** List one institution for seeing **********************/
/*****************************************************************************/
static void Ins_ListOneInstitutionForSeeing (struct Instit *Ins,unsigned NumIns)
static void Ins_ListOneInstitutionForSeeing (struct Ins_Instit *Ins,unsigned NumIns)
{
extern const char *Txt_INSTITUTION_STATUS[Ins_NUM_STATUS_TXT];
const char *TxtClassNormal;
@ -623,7 +623,7 @@ void Ins_GetBasicListOfInstitutions (long CtyCod)
MYSQL_ROW row;
unsigned long NumRows = 0; // Initialized to avoid warning
unsigned NumIns;
struct Instit *Ins;
struct Ins_Instit *Ins;
/***** Get institutions from database *****/
NumRows = DB_QuerySELECT (&mysql_res,"can not get institutions",
@ -645,8 +645,8 @@ void Ins_GetBasicListOfInstitutions (long CtyCod)
Gbl.Hierarchy.Inss.Num = (unsigned) NumRows;
/***** Create list with institutions *****/
if ((Gbl.Hierarchy.Inss.Lst = (struct Instit *)
calloc (NumRows,sizeof (struct Instit))) == NULL)
if ((Gbl.Hierarchy.Inss.Lst = (struct Ins_Instit *)
calloc (NumRows,sizeof (struct Ins_Instit))) == NULL)
Lay_NotEnoughMemoryExit ();
/***** Get the institutions *****/
@ -690,7 +690,7 @@ void Ins_GetFullListOfInstitutions (long CtyCod)
MYSQL_ROW row;
unsigned long NumRows = 0; // Initialized to avoid warning
unsigned NumIns;
struct Instit *Ins;
struct Ins_Instit *Ins;
/***** Get institutions from database *****/
/* Query database */
@ -729,8 +729,8 @@ void Ins_GetFullListOfInstitutions (long CtyCod)
Gbl.Hierarchy.Inss.Num = (unsigned) NumRows;
/***** Create list with institutions *****/
if ((Gbl.Hierarchy.Inss.Lst = (struct Instit *)
calloc (NumRows,sizeof (struct Instit))) == NULL)
if ((Gbl.Hierarchy.Inss.Lst = (struct Ins_Instit *)
calloc (NumRows,sizeof (struct Ins_Instit))) == NULL)
Lay_NotEnoughMemoryExit ();
/***** Get the institutions *****/
@ -767,7 +767,7 @@ void Ins_GetFullListOfInstitutions (long CtyCod)
void Ins_WriteInstitutionNameAndCty (long InsCod)
{
struct Instit Ins;
struct Ins_Instit Ins;
char CtyName[Hie_MAX_BYTES_FULL_NAME + 1];
/***** Get institution short name and country name *****/
@ -782,7 +782,7 @@ void Ins_WriteInstitutionNameAndCty (long InsCod)
/************************* Get data of an institution ************************/
/*****************************************************************************/
bool Ins_GetDataOfInstitutionByCod (struct Instit *Ins)
bool Ins_GetDataOfInstitutionByCod (struct Ins_Instit *Ins)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -831,7 +831,7 @@ bool Ins_GetDataOfInstitutionByCod (struct Instit *Ins)
/********** Get data of a centre from a row resulting of a query *************/
/*****************************************************************************/
static void Ins_GetDataOfInstitFromRow (struct Instit *Ins,MYSQL_ROW row)
static void Ins_GetDataOfInstitFromRow (struct Ins_Instit *Ins,MYSQL_ROW row)
{
/***** Get institution code (row[0]) *****/
if ((Ins->InsCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
@ -870,7 +870,7 @@ void Ins_FlushCacheShortNameOfInstitution (void)
Gbl.Cache.InstitutionShrtName.ShrtName[0] = '\0';
}
void Ins_GetShortNameOfInstitution (struct Instit *Ins)
void Ins_GetShortNameOfInstitution (struct Ins_Instit *Ins)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -926,7 +926,7 @@ void Ins_FlushCacheFullNameAndCtyOfInstitution (void)
Gbl.Cache.InstitutionShrtNameAndCty.CtyName[0] = '\0';
}
static void Ins_GetShrtNameAndCtyOfInstitution (struct Instit *Ins,
static void Ins_GetShrtNameAndCtyOfInstitution (struct Ins_Instit *Ins,
char CtyName[Hie_MAX_BYTES_FULL_NAME + 1])
{
extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
@ -1076,7 +1076,7 @@ static void Ins_ListInstitutionsForEdition (void)
{
extern const char *Txt_INSTITUTION_STATUS[Ins_NUM_STATUS_TXT];
unsigned NumIns;
struct Instit *Ins;
struct Ins_Instit *Ins;
char WWW[Cns_MAX_BYTES_WWW + 1];
struct UsrData UsrDat;
bool ICanEdit;
@ -1244,7 +1244,7 @@ static void Ins_ListInstitutionsForEdition (void)
/************ Check if I can edit, remove, etc. an institution ***************/
/*****************************************************************************/
static bool Ins_CheckIfICanEdit (struct Instit *Ins)
static bool Ins_CheckIfICanEdit (struct Ins_Instit *Ins)
{
return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM || // I am a superuser
((Ins->Status & Ins_STATUS_BIT_PENDING) != 0 && // Institution is not yet activated
@ -1450,7 +1450,7 @@ void Ins_RenameInsFull (void)
/******************** Change the name of an institution **********************/
/*****************************************************************************/
void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtOrFullName)
void Ins_RenameInstitution (struct Ins_Instit *Ins,Cns_ShrtOrFullName_t ShrtOrFullName)
{
extern const char *Txt_The_institution_X_already_exists;
extern const char *Txt_The_institution_X_has_been_renamed_as_Y;
@ -2123,7 +2123,7 @@ void Ins_ListInssFound (MYSQL_RES **mysql_res,unsigned NumInss)
extern const char *Txt_institutions;
MYSQL_ROW row;
unsigned NumIns;
struct Instit Ins;
struct Ins_Instit Ins;
/***** List the institutions (one row per institution) *****/
if (NumInss)
@ -2177,7 +2177,7 @@ static void Ins_EditingInstitutionConstructor (void)
Lay_ShowErrorAndExit ("Error initializing institution.");
/***** Allocate memory for institution *****/
if ((Ins_EditingIns = (struct Instit *) malloc (sizeof (struct Instit))) == NULL)
if ((Ins_EditingIns = (struct Ins_Instit *) malloc (sizeof (struct Ins_Instit))) == NULL)
Lay_ShowErrorAndExit ("Error allocating memory for institution.");
/***** Reset institution *****/
@ -2202,7 +2202,7 @@ static void Ins_EditingInstitutionDestructor (void)
/********************* Form to go to institution map *************************/
/*****************************************************************************/
static void Ins_FormToGoToMap (struct Instit *Ins)
static void Ins_FormToGoToMap (struct Ins_Instit *Ins)
{
extern const char *Txt_Map;

View File

@ -56,7 +56,7 @@ typedef enum
#define Ins_MAX_INSTITS_PER_USR 10 // Used in list of my institutions
struct Instit
struct Ins_Instit
{
long InsCod;
long CtyCod;
@ -83,7 +83,7 @@ typedef enum
struct ListInstits
{
unsigned Num; // Number of institutions
struct Instit *Lst; // List of institutions
struct Ins_Instit *Lst; // List of institutions
Ins_Order_t SelectedOrder; // Order of institutions
};
@ -93,8 +93,8 @@ struct ListInstits
void Ins_SeeInsWithPendingCtrs (void);
void Ins_DrawInstitutionLogoWithLink (struct Instit *Ins,unsigned Size);
void Ins_DrawInstitutionLogoAndNameWithLink (struct Instit *Ins,Act_Action_t Action,
void Ins_DrawInstitutionLogoWithLink (struct Ins_Instit *Ins,unsigned Size);
void Ins_DrawInstitutionLogoAndNameWithLink (struct Ins_Instit *Ins,Act_Action_t Action,
const char *ClassLink,const char *ClassLogo);
void Ins_ShowInssOfCurrentCty (void);
@ -103,9 +103,9 @@ void Ins_GetBasicListOfInstitutions (long CtyCod);
void Ins_GetFullListOfInstitutions (long CtyCod);
void Ins_WriteInstitutionNameAndCty (long InsCod);
bool Ins_GetDataOfInstitutionByCod (struct Instit *Ins);
bool Ins_GetDataOfInstitutionByCod (struct Ins_Instit *Ins);
void Ins_FlushCacheShortNameOfInstitution (void);
void Ins_GetShortNameOfInstitution (struct Instit *Ins);
void Ins_GetShortNameOfInstitution (struct Ins_Instit *Ins);
void Ins_FlushCacheFullNameAndCtyOfInstitution (void);
void Ins_FreeListInstitutions (void);
@ -116,7 +116,7 @@ long Ins_GetAndCheckParamOtherInsCod (long MinCodAllowed);
void Ins_RemoveInstitution (void);
void Ins_RenameInsShort (void);
void Ins_RenameInsFull (void);
void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtOrFullName);
void Ins_RenameInstitution (struct Ins_Instit *Ins,Cns_ShrtOrFullName_t ShrtOrFullName);
bool Ins_CheckIfInsNameExistsInCty (const char *FieldName,
const char *Name,
long InsCod,

View File

@ -282,7 +282,7 @@ static void InsCfg_Map (void)
unsigned Zoom;
unsigned NumCtrs;
unsigned NumCtr;
struct Centre Ctr;
struct Ctr_Centre Ctr;
/***** Leaflet CSS *****/
Map_LeafletCSS ();

View File

@ -1711,9 +1711,9 @@ static void Lay_WriteFootFromHTMLFile (void)
void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto,
long InsCod,long DegCod,long CrsCod)
{
struct Instit Ins;
struct Degree Deg;
struct Course Crs;
struct Ins_Instit Ins;
struct Deg_Degree Deg;
struct Crs_Course Crs;
/***** Get data of institution *****/
Ins.InsCod = InsCod;

View File

@ -263,9 +263,9 @@ void Log_GetAndShowLastClicks (void)
const char *ClassRow;
time_t TimeDiff;
struct Country Cty;
struct Instit Ins;
struct Centre Ctr;
struct Degree Deg;
struct Ins_Instit Ins;
struct Ctr_Centre Ctr;
struct Deg_Degree Deg;
/***** Get last clicks from database *****/
NumRows = DB_QuerySELECT (&mysql_res,"can not get last clicks",

View File

@ -120,9 +120,9 @@ extern struct Globals Gbl;
/***************************** Private prototypes ****************************/
/*****************************************************************************/
static void Med_ResetMediaExceptURLAndTitle (struct Media *Media);
static void Med_FreeMediaURL (struct Media *Media);
static void Med_FreeMediaTitle (struct Media *Media);
static void Med_ResetMediaExceptURLAndTitle (struct Med_Media *Media);
static void Med_FreeMediaURL (struct Med_Media *Media);
static void Med_FreeMediaTitle (struct Med_Media *Media);
static void Med_PutIconMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
struct MediaUploader *MediaUploader);
@ -132,46 +132,46 @@ static void Med_PutHiddenFormTypeMediaUploader (const char UniqueId[Frm_MAX_BYTE
static Med_Action_t Med_GetMediaActionFromForm (const char *ParamAction);
static Med_FormType_t Usr_GetFormTypeFromForm (struct ParamUploadMedia *ParamUploadMedia);
static void Usr_GetURLFromForm (const char *ParamName,struct Media *Media);
static void Usr_GetTitleFromForm (const char *ParamName,struct Media *Media);
static void Usr_GetURLFromForm (const char *ParamName,struct Med_Media *Media);
static void Usr_GetTitleFromForm (const char *ParamName,struct Med_Media *Media);
static void Med_GetAndProcessFileFromForm (const char *ParamFile,
struct Media *Media);
static bool Med_DetectIfAnimated (struct Media *Media,
struct Med_Media *Media);
static bool Med_DetectIfAnimated (struct Med_Media *Media,
const char PathFileOrg[PATH_MAX + 1]);
static void Med_ProcessJPG (struct Media *Media,
static void Med_ProcessJPG (struct Med_Media *Media,
const char PathFileOrg[PATH_MAX + 1]);
static void Med_ProcessGIF (struct Media *Media,
static void Med_ProcessGIF (struct Med_Media *Media,
const char PathFileOrg[PATH_MAX + 1]);
static void Med_ProcessVideo (struct Media *Media,
static void Med_ProcessVideo (struct Med_Media *Media,
const char PathFileOrg[PATH_MAX + 1]);
static int Med_ResizeImage (struct Media *Media,
static int Med_ResizeImage (struct Med_Media *Media,
const char PathFileOriginal[PATH_MAX + 1],
const char PathFileProcessed[PATH_MAX + 1]);
static int Med_GetFirstFrame (const char PathFileOriginal[PATH_MAX + 1],
const char PathFileProcessed[PATH_MAX + 1]);
static void Med_GetAndProcessYouTubeFromForm (const char *ParamURL,
struct Media *Media);
struct Med_Media *Media);
static void Med_GetAndProcessEmbedFromForm (const char *ParamURL,
struct Media *Media);
struct Med_Media *Media);
static bool Med_MoveTmpFileToDefDir (struct Media *Media,
static bool Med_MoveTmpFileToDefDir (struct Med_Media *Media,
const char PathMedPriv[PATH_MAX + 1],
const char *Extension);
static void Med_ShowJPG (const struct Media *Media,
static void Med_ShowJPG (const struct Med_Media *Media,
const char PathMedPriv[PATH_MAX + 1],
const char *ClassMedia);
static void Med_ShowGIF (const struct Media *Media,
static void Med_ShowGIF (const struct Med_Media *Media,
const char PathMedPriv[PATH_MAX + 1],
const char *ClassMedia);
static void Med_ShowVideo (const struct Media *Media,
static void Med_ShowVideo (const struct Med_Media *Media,
const char PathMedPriv[PATH_MAX + 1],
const char *ClassMedia);
static void Med_ShowYoutube (const struct Media *Media,const char *ClassMedia);
static void Med_ShowEmbed (const struct Media *Media,const char *ClassMedia);
static void Med_ShowYoutube (const struct Med_Media *Media,const char *ClassMedia);
static void Med_ShowEmbed (const struct Med_Media *Media,const char *ClassMedia);
static void Med_AlertThirdPartyCookies (void);
static Med_Type_t Med_GetTypeFromStrInDB (const char *Str);
@ -182,10 +182,10 @@ static const char *Med_GetStringTypeForDB (Med_Type_t Type);
/*****************************************************************************/
/********************** Media (image/video) constructor **********************/
/*****************************************************************************/
// Every struct Media must be initialized with this constructor function after it is declared
// Every struct Med_Media must be initialized with this constructor function after it is declared
// Every call to constructor must have a call to destructor
void Med_MediaConstructor (struct Media *Media)
void Med_MediaConstructor (struct Med_Media *Media)
{
Med_ResetMediaExceptURLAndTitle (Media);
Media->URL = NULL;
@ -197,7 +197,7 @@ void Med_MediaConstructor (struct Media *Media)
/*****************************************************************************/
// Every call to constructor must have a call to destructor
void Med_MediaDestructor (struct Media *Media)
void Med_MediaDestructor (struct Med_Media *Media)
{
Med_ResetMedia (Media);
}
@ -207,7 +207,7 @@ void Med_MediaDestructor (struct Media *Media)
/*****************************************************************************/
// Media must be constructed before calling this function
void Med_ResetMedia (struct Media *Media)
void Med_ResetMedia (struct Med_Media *Media)
{
Med_ResetMediaExceptURLAndTitle (Media);
Med_FreeMediaURL (Media);
@ -218,7 +218,7 @@ void Med_ResetMedia (struct Media *Media)
/***************** Reset media fields except URL and title *******************/
/*****************************************************************************/
static void Med_ResetMediaExceptURLAndTitle (struct Media *Media)
static void Med_ResetMediaExceptURLAndTitle (struct Med_Media *Media)
{
Media->MedCod = -1L;
Media->Action = Med_ACTION_NO_MEDIA;
@ -231,7 +231,7 @@ static void Med_ResetMediaExceptURLAndTitle (struct Media *Media)
/******************************* Free image URL ******************************/
/*****************************************************************************/
static void Med_FreeMediaURL (struct Media *Media)
static void Med_FreeMediaURL (struct Med_Media *Media)
{
// Media->URL is initialized to NULL in constructor
if (Media->URL)
@ -245,7 +245,7 @@ static void Med_FreeMediaURL (struct Media *Media)
/****************************** Free image title *****************************/
/*****************************************************************************/
static void Med_FreeMediaTitle (struct Media *Media)
static void Med_FreeMediaTitle (struct Med_Media *Media)
{
// Media->Title is initialized to NULL in constructor
if (Media->Title)
@ -259,7 +259,7 @@ static void Med_FreeMediaTitle (struct Media *Media)
/**** Get media name, title and URL from a query result and copy to struct ***/
/*****************************************************************************/
void Med_GetMediaDataByCod (struct Media *Media)
void Med_GetMediaDataByCod (struct Med_Media *Media)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -510,8 +510,8 @@ static void Med_PutHiddenFormTypeMediaUploader (const char UniqueId[Frm_MAX_BYTE
// If NumMediaInForm < 0, params have no suffix
// If NumMediaInForm >= 0, the number is a suffix of the params
void Med_GetMediaFromForm (long CrsCod,long QstCod,int NumMediaInForm,struct Media *Media,
void (*GetMediaFromDB) (long CrsCod,long QstCod,int NumMediaInForm,struct Media *Media),
void Med_GetMediaFromForm (long CrsCod,long QstCod,int NumMediaInForm,struct Med_Media *Media,
void (*GetMediaFromDB) (long CrsCod,long QstCod,int NumMediaInForm,struct Med_Media *Media),
const char *SectionForAlerts)
{
extern const char *Txt_Error_sending_or_processing_image_video;
@ -663,7 +663,7 @@ static Med_FormType_t Usr_GetFormTypeFromForm (struct ParamUploadMedia *ParamUpl
/********************* Get from form the type of form ************************/
/*****************************************************************************/
static void Usr_GetURLFromForm (const char *ParamName,struct Media *Media)
static void Usr_GetURLFromForm (const char *ParamName,struct Med_Media *Media)
{
char URL[Cns_MAX_BYTES_WWW + 1];
size_t Length;
@ -688,7 +688,7 @@ static void Usr_GetURLFromForm (const char *ParamName,struct Media *Media)
/********************* Get from form the type of form ************************/
/*****************************************************************************/
static void Usr_GetTitleFromForm (const char *ParamName,struct Media *Media)
static void Usr_GetTitleFromForm (const char *ParamName,struct Med_Media *Media)
{
char Title[Med_MAX_BYTES_TITLE + 1];
size_t Length;
@ -714,7 +714,7 @@ static void Usr_GetTitleFromForm (const char *ParamName,struct Media *Media)
/*****************************************************************************/
static void Med_GetAndProcessFileFromForm (const char *ParamFile,
struct Media *Media)
struct Med_Media *Media)
{
struct Param *Param;
char FileNameImgSrc[PATH_MAX + 1];
@ -803,7 +803,7 @@ static void Med_GetAndProcessFileFromForm (const char *ParamFile,
// Return true if animated
// Return false if static or error
static bool Med_DetectIfAnimated (struct Media *Media,
static bool Med_DetectIfAnimated (struct Med_Media *Media,
const char PathFileOrg[PATH_MAX + 1])
{
char PathFileTxtTmp[PATH_MAX + 1];
@ -845,7 +845,7 @@ static bool Med_DetectIfAnimated (struct Media *Media,
/************* Process original image generating processed JPG ***************/
/*****************************************************************************/
static void Med_ProcessJPG (struct Media *Media,
static void Med_ProcessJPG (struct Med_Media *Media,
const char PathFileOrg[PATH_MAX + 1])
{
extern const char *Txt_The_file_could_not_be_processed_successfully;
@ -874,7 +874,7 @@ static void Med_ProcessJPG (struct Media *Media,
/******* Process original GIF image generating processed PNG and GIF *********/
/*****************************************************************************/
static void Med_ProcessGIF (struct Media *Media,
static void Med_ProcessGIF (struct Med_Media *Media,
const char PathFileOrg[PATH_MAX + 1])
{
extern const char *Txt_The_file_could_not_be_processed_successfully;
@ -943,7 +943,7 @@ static void Med_ProcessGIF (struct Media *Media,
/*********** Process original MP4 video generating processed MP4 *************/
/*****************************************************************************/
static void Med_ProcessVideo (struct Media *Media,
static void Med_ProcessVideo (struct Med_Media *Media,
const char PathFileOrg[PATH_MAX + 1])
{
extern const char *Txt_The_file_could_not_be_processed_successfully;
@ -989,7 +989,7 @@ static void Med_ProcessVideo (struct Media *Media,
// Return 0 on success
// Return != 0 on error
static int Med_ResizeImage (struct Media *Media,
static int Med_ResizeImage (struct Med_Media *Media,
const char PathFileOriginal[PATH_MAX + 1],
const char PathFileProcessed[PATH_MAX + 1])
{
@ -1041,7 +1041,7 @@ static int Med_GetFirstFrame (const char PathFileOriginal[PATH_MAX + 1],
/*****************************************************************************/
static void Med_GetAndProcessYouTubeFromForm (const char *ParamURL,
struct Media *Media)
struct Med_Media *Media)
{
extern const char Str_BIN_TO_BASE64URL[64 + 1];
char *PtrHost = NULL;
@ -1206,7 +1206,7 @@ static void Med_GetAndProcessYouTubeFromForm (const char *ParamURL,
/*****************************************************************************/
static void Med_GetAndProcessEmbedFromForm (const char *ParamURL,
struct Media *Media)
struct Med_Media *Media)
{
extern const char Str_BIN_TO_BASE64URL[64 + 1];
char *PtrHost = NULL;
@ -1255,7 +1255,7 @@ static void Med_GetAndProcessEmbedFromForm (const char *ParamURL,
/**** Remove media, keep media or store media, depending on media action *****/
/*****************************************************************************/
void Med_RemoveKeepOrStoreMedia (long CurrentMedCodInDB,struct Media *Media)
void Med_RemoveKeepOrStoreMedia (long CurrentMedCodInDB,struct Med_Media *Media)
{
switch (Media->Action)
{
@ -1299,7 +1299,7 @@ void Med_RemoveKeepOrStoreMedia (long CurrentMedCodInDB,struct Media *Media)
/**** Move temporary processed media file to definitive private directory ****/
/*****************************************************************************/
void Med_MoveMediaToDefinitiveDir (struct Media *Media)
void Med_MoveMediaToDefinitiveDir (struct Med_Media *Media)
{
char PathMedPriv[PATH_MAX + 1];
@ -1372,7 +1372,7 @@ void Med_MoveMediaToDefinitiveDir (struct Media *Media)
// Return true on success
// Return false on error
static bool Med_MoveTmpFileToDefDir (struct Media *Media,
static bool Med_MoveTmpFileToDefDir (struct Med_Media *Media,
const char PathMedPriv[PATH_MAX + 1],
const char *Extension)
{
@ -1403,7 +1403,7 @@ static bool Med_MoveTmpFileToDefDir (struct Media *Media,
/************************ Store media into database **************************/
/*****************************************************************************/
void Med_StoreMediaInDB (struct Media *Media)
void Med_StoreMediaInDB (struct Med_Media *Media)
{
/***** Insert media into database *****/
Media->MedCod = DB_QueryINSERTandReturnCode ("can not create media",
@ -1422,7 +1422,7 @@ void Med_StoreMediaInDB (struct Media *Media)
/****** Show a user uploaded media (in a test question, timeline, etc.) ******/
/*****************************************************************************/
void Med_ShowMedia (const struct Media *Media,
void Med_ShowMedia (const struct Med_Media *Media,
const char *ClassContainer,const char *ClassMedia)
{
bool PutLink;
@ -1507,7 +1507,7 @@ void Med_ShowMedia (const struct Media *Media,
/************************** Show a user uploaded JPG *************************/
/*****************************************************************************/
static void Med_ShowJPG (const struct Media *Media,
static void Med_ShowJPG (const struct Med_Media *Media,
const char PathMedPriv[PATH_MAX + 1],
const char *ClassMedia)
{
@ -1563,7 +1563,7 @@ static void Med_ShowJPG (const struct Media *Media,
/************************** Show a user uploaded GIF *************************/
/*****************************************************************************/
static void Med_ShowGIF (const struct Media *Media,
static void Med_ShowGIF (const struct Med_Media *Media,
const char PathMedPriv[PATH_MAX + 1],
const char *ClassMedia)
{
@ -1663,7 +1663,7 @@ static void Med_ShowGIF (const struct Media *Media,
/************************ Show a user uploaded video *************************/
/*****************************************************************************/
static void Med_ShowVideo (const struct Media *Media,
static void Med_ShowVideo (const struct Med_Media *Media,
const char PathMedPriv[PATH_MAX + 1],
const char *ClassMedia)
{
@ -1729,7 +1729,7 @@ static void Med_ShowVideo (const struct Media *Media,
/*********************** Show an embed YouTube video *************************/
/*****************************************************************************/
static void Med_ShowYoutube (const struct Media *Media,const char *ClassMedia)
static void Med_ShowYoutube (const struct Med_Media *Media,const char *ClassMedia)
{
/***** Check if YouTube code exists *****/
if (Media->Name[0]) // YouTube code
@ -1769,7 +1769,7 @@ static void Med_ShowYoutube (const struct Media *Media,const char *ClassMedia)
/*************************** Show an embed media *****************************/
/*****************************************************************************/
static void Med_ShowEmbed (const struct Media *Media,const char *ClassMedia)
static void Med_ShowEmbed (const struct Med_Media *Media,const char *ClassMedia)
{
/***** Check if embed URL exists *****/
if (Media->URL[0]) // Embed URL
@ -1838,10 +1838,10 @@ static void Med_AlertThirdPartyCookies (void)
#define Med_SRC 0
#define Med_DST 1
long Med_CloneMedia (const struct Media *MediaSrc)
long Med_CloneMedia (const struct Med_Media *MediaSrc)
{
long MedCod = -1L;
struct Media MediaDst;
struct Med_Media MediaDst;
struct
{
char Path[PATH_MAX + 1];
@ -1990,7 +1990,7 @@ void Med_RemoveMedia (long MedCod)
{
char PathMedPriv[PATH_MAX + 1];
char *FullPathMediaPriv;
struct Media Media;
struct Med_Media Media;
/***** Trivial case *****/
if (MedCod <= 0)

View File

@ -104,7 +104,7 @@ typedef enum
} Med_Type_t;
/***** Struct used to get images/videos from forms *****/
struct Media
struct Med_Media
{
long MedCod;
Med_Action_t Action;
@ -138,26 +138,26 @@ struct ParamUploadMedia
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void Med_MediaConstructor (struct Media *Media);
void Med_MediaDestructor (struct Media *Media);
void Med_ResetMedia (struct Media *Media);
void Med_MediaConstructor (struct Med_Media *Media);
void Med_MediaDestructor (struct Med_Media *Media);
void Med_ResetMedia (struct Med_Media *Media);
void Med_GetMediaDataByCod (struct Media *Media);
void Med_GetMediaDataByCod (struct Med_Media *Media);
void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput);
void Med_GetMediaFromForm (long CrsCod,long QstCod,int NumMediaInForm,struct Media *Media,
void (*GetMediaFromDB) (long CrsCod,long QstCod,int NumMediaInForm,struct Media *Media),
void Med_GetMediaFromForm (long CrsCod,long QstCod,int NumMediaInForm,struct Med_Media *Media,
void (*GetMediaFromDB) (long CrsCod,long QstCod,int NumMediaInForm,struct Med_Media *Media),
const char *SectionForAlerts);
void Med_SetParamNames (struct ParamUploadMedia *ParamUploadMedia,int NumMediaInForm);
void Med_RemoveKeepOrStoreMedia (long CurrentMedCodInDB,struct Media *Media);
void Med_MoveMediaToDefinitiveDir (struct Media *Media);
void Med_StoreMediaInDB (struct Media *Media);
void Med_RemoveKeepOrStoreMedia (long CurrentMedCodInDB,struct Med_Media *Media);
void Med_MoveMediaToDefinitiveDir (struct Med_Media *Media);
void Med_StoreMediaInDB (struct Med_Media *Media);
void Med_ShowMedia (const struct Media *Media,
void Med_ShowMedia (const struct Med_Media *Media,
const char *ClassContainer,const char *ClassMedia);
long Med_CloneMedia (const struct Media *MediaSrc);
long Med_CloneMedia (const struct Med_Media *MediaSrc);
void Med_RemoveMediaFromAllRows (unsigned NumMedia,MYSQL_RES *mysql_res);
void Med_RemoveMedia (long MedCod);

View File

@ -145,7 +145,7 @@ static void Msg_ContractSentMsg (long MsgCod);
static void Msg_ContractReceivedMsg (long MsgCod);
static long Msg_InsertNewMsg (const char *Subject,const char *Content,
struct Media *Media);
struct Med_Media *Media);
static unsigned long Msg_DelSomeRecOrSntMsgsUsr (const struct Msg_Messages *Messages,
long UsrCod,
@ -166,7 +166,7 @@ static void Msg_GetMsgSntData (long MsgCod,long *CrsCod,long *UsrCod,
bool *Deleted);
static void Msg_GetMsgSubject (long MsgCod,char Subject[Cns_MAX_BYTES_SUBJECT + 1]);
static void Msg_GetMsgContent (long MsgCod,char Content[Cns_MAX_BYTES_LONG_TEXT + 1],
struct Media *Media);
struct Med_Media *Media);
static void Msg_WriteSentOrReceivedMsgSubject (struct Msg_Messages *Messages,
long MsgCod,const char *Subject,
@ -760,7 +760,7 @@ void Msg_RecMsgFromUsr (void)
bool CreateNotif;
bool NotifyByEmail;
char Content[Cns_MAX_BYTES_LONG_TEXT + 1];
struct Media Media;
struct Med_Media Media;
bool Error = false;
/***** Reset messages context *****/
@ -1122,7 +1122,7 @@ static void Msg_ShowNumMsgsDeleted (unsigned NumMsgs)
static void Msg_GetParamMsgsCrsCod (struct Msg_Messages *Messages)
{
extern const char *Txt_any_course;
struct Course Crs;
struct Crs_Course Crs;
if ((Messages->FilterCrsCod = Par_GetParToLong ("FilterCrsCod")) > 0) // If origin course specified
{
@ -1409,7 +1409,7 @@ void Msg_SetReceivedMsgAsOpen (long MsgCod,long UsrCod)
// Return the code of the new inserted message
static long Msg_InsertNewMsg (const char *Subject,const char *Content,
struct Media *Media)
struct Med_Media *Media)
{
long MsgCod;
@ -2752,7 +2752,7 @@ static void Msg_GetDistinctCoursesInMyMessages (struct Msg_Messages *Messages)
MYSQL_ROW row;
unsigned long NumRow;
unsigned long NumRows = 0; // Initialized to avoid warning
struct Course Crs;
struct Crs_Course Crs;
/***** Get distinct courses in my messages from database *****/
switch (Messages->TypeOfMessages)
@ -3006,7 +3006,7 @@ static void Msg_GetMsgSubject (long MsgCod,char Subject[Cns_MAX_BYTES_SUBJECT +
/*****************************************************************************/
static void Msg_GetMsgContent (long MsgCod,char Content[Cns_MAX_BYTES_LONG_TEXT + 1],
struct Media *Media)
struct Med_Media *Media)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -3133,7 +3133,7 @@ static void Msg_ShowASentOrReceivedMessage (struct Msg_Messages *Messages,
long CrsCod;
char Subject[Cns_MAX_BYTES_SUBJECT + 1];
char Content[Cns_MAX_BYTES_LONG_TEXT + 1];
struct Media Media;
struct Med_Media Media;
bool Deleted;
bool Open = true;
bool Replied = false; // Initialized to avoid warning
@ -3474,7 +3474,7 @@ static bool Msg_WriteCrsOrgMsg (long CrsCod)
{
extern const char *Txt_from_this_course;
extern const char *Txt_no_course_of_origin;
struct Course Crs;
struct Crs_Course Crs;
bool FromThisCrs = true;
bool ThereIsOrgCrs = false;

View File

@ -43,6 +43,7 @@
#include "swad_parameter.h"
#include "swad_RSS.h"
#include "swad_timeline.h"
#include "swad_timeline_note.h"
/*****************************************************************************/
/************** External global variables from others modules ****************/
@ -156,7 +157,7 @@ void Not_ReceiveNotice (void)
Not_UpdateNumUsrsNotifiedByEMailAboutNotice (NotCod,NumUsrsToBeNotifiedByEMail);
/***** Create a new social note about the new notice *****/
TL_StoreAndPublishNote (TL_NOTE_NOTICE,NotCod);
TL_Not_StoreAndPublishNote (TL_NOTE_NOTICE,NotCod);
/***** Set notice to be highlighted *****/
Gbl.Crs.Notices.HighlightNotCod = NotCod;
@ -340,7 +341,7 @@ void Not_RemoveNotice (void)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_NOTICE,NotCod);
/***** Mark possible social note as unavailable *****/
TL_MarkNoteAsUnavailable (TL_NOTE_NOTICE,NotCod);
TL_Not_MarkNoteAsUnavailable (TL_NOTE_NOTICE,NotCod);
/***** Update RSS of current course *****/
RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs);

View File

@ -321,10 +321,10 @@ void Ntf_ShowMyNotifications (void)
bool AllNotifications;
Ntf_NotifyEvent_t NotifyEvent = (Ntf_NotifyEvent_t) 0; // Initialized to avoid warning
struct UsrData UsrDat;
struct Instit Ins;
struct Centre Ctr;
struct Degree Deg;
struct Course Crs;
struct Ins_Instit Ins;
struct Ctr_Centre Ctr;
struct Deg_Degree Deg;
struct Crs_Course Crs;
long Cod;
struct For_Forums Forums;
char ForumName[For_MAX_BYTES_FORUM_NAME + 1];
@ -1584,10 +1584,10 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
Lan_Language_t ToUsrLanguage;
struct UsrData FromUsrDat;
Ntf_NotifyEvent_t NotifyEvent = (Ntf_NotifyEvent_t) 0; // Initialized to avoid warning
struct Instit Ins;
struct Centre Ctr;
struct Degree Deg;
struct Course Crs;
struct Ins_Instit Ins;
struct Ctr_Centre Ctr;
struct Deg_Degree Deg;
struct Crs_Course Crs;
long Cod;
struct For_Forum ForumSelected;
char ForumName[For_MAX_BYTES_FORUM_NAME + 1];

View File

@ -133,7 +133,7 @@ static unsigned long Pho_BuildQueryOfDegrees (Pho_HowOrderDegrees_t HowOrderDegr
static void Pho_GetNumStdsInDegree (long DegCod,Usr_Sex_t Sex,int *NumStds,int *NumStdsWithPhoto);
static void Pho_UpdateDegStats (long DegCod,Usr_Sex_t Sex,unsigned NumStds,unsigned NumStdsWithPhoto,long TimeToComputeAvgPhoto);
static void Pho_ShowDegreeStat (int NumStds,int NumStdsWithPhoto);
static void Pho_ShowDegreeAvgPhotoAndStat (const struct Degree *Deg,
static void Pho_ShowDegreeAvgPhotoAndStat (const struct Deg_Degree *Deg,
const struct Pho_DegPhotos *DegPhotos,
Pho_AvgPhotoSeeOrPrint_t SeeOrPrint,
Usr_Sex_t Sex,
@ -2017,7 +2017,7 @@ static void Pho_PutLinkToCalculateDegreeStats (const struct Pho_DegPhotos *DegPh
extern const char *Txt_time;
struct ListDegrees Degs;
unsigned NumDeg;
struct Degree Deg;
struct Deg_Degree Deg;
long EstimatedTimeToComputeAvgPhotoInMicroseconds;
char StrEstimatedTimeToComputeAvgPhoto[Dat_MAX_BYTES_TIME + 1];
bool Selected;
@ -2144,7 +2144,7 @@ static void Pho_ShowOrPrintClassPhotoDegrees (struct Pho_DegPhotos *DegPhotos,
MYSQL_ROW row;
unsigned long NumDeg;
unsigned long NumDegs;
struct Degree Deg;
struct Deg_Degree Deg;
unsigned NumDegsNotEmpty;
int NumStds;
int NumStdsWithPhoto;
@ -2231,7 +2231,7 @@ static void Pho_ShowOrPrintListDegrees (struct Pho_DegPhotos *DegPhotos,
unsigned NumDegsNotEmpty;
int NumStds;
int NumStdsWithPhoto;
struct Degree Deg;
struct Deg_Degree Deg;
Usr_Sex_t Sex;
/***** Get degrees from database *****/
@ -2455,7 +2455,7 @@ static void Pho_ShowDegreeStat (int NumStds,int NumStdsWithPhoto)
/******************* Show the average photo of a degree **********************/
/*****************************************************************************/
static void Pho_ShowDegreeAvgPhotoAndStat (const struct Degree *Deg,
static void Pho_ShowDegreeAvgPhotoAndStat (const struct Deg_Degree *Deg,
const struct Pho_DegPhotos *DegPhotos,
Pho_AvgPhotoSeeOrPrint_t SeeOrPrint,
Usr_Sex_t Sex,

View File

@ -114,7 +114,7 @@ static void Rec_PutParamsStdTsts (__attribute__((unused)) void *Args);
static void Rec_PutParamsWorks (__attribute__((unused)) void *Args);
static void Rec_PutParamsStudent (__attribute__((unused)) void *Args);
static void Rec_PutParamsMsgUsr (__attribute__((unused)) void *Args);
static void Rec_ShowInstitutionInHead (struct Instit *Ins,bool PutFormLinks);
static void Rec_ShowInstitutionInHead (struct Ins_Instit *Ins,bool PutFormLinks);
static void Rec_ShowPhoto (struct UsrData *UsrDat);
static void Rec_ShowFullName (struct UsrData *UsrDat);
static void Rec_ShowNickname (struct UsrData *UsrDat,bool PutFormLinks);
@ -133,9 +133,9 @@ static void Rec_ShowDateOfBirth (struct UsrData *UsrDat,bool ShowData,bool PutFo
static void Rec_ShowPhone (struct UsrData *UsrDat,bool ShowData,bool PutForm,
unsigned NumPhone);
static void Rec_ShowComments (struct UsrData *UsrDat,bool ShowData,bool PutForm);
static void Rec_ShowTeacherRows (struct UsrData *UsrDat,struct Instit *Ins,
static void Rec_ShowTeacherRows (struct UsrData *UsrDat,struct Ins_Instit *Ins,
bool ShowData);
static void Rec_ShowInstitution (struct Instit *Ins,bool ShowData);
static void Rec_ShowInstitution (struct Ins_Instit *Ins,bool ShowData);
static void Rec_ShowCentre (struct UsrData *UsrDat,bool ShowData);
static void Rec_ShowDepartment (struct UsrData *UsrDat,bool ShowData);
static void Rec_ShowOffice (struct UsrData *UsrDat,bool ShowData);
@ -1941,7 +1941,7 @@ void Rec_UpdateCrsRecord (long UsrCod)
/************ Remove fields of record of a user in current course ************/
/*****************************************************************************/
void Rec_RemoveFieldsCrsRecordInCrs (long UsrCod,struct Course *Crs)
void Rec_RemoveFieldsCrsRecordInCrs (long UsrCod,struct Crs_Course *Crs)
{
/***** Remove text of the field of record course *****/
DB_QueryDELETE ("can not remove user's record in a course",
@ -2165,7 +2165,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView,
bool StudentInCurrentCrs;
bool TeacherInCurrentCrs;
bool ShowTeacherRows;
struct Instit Ins;
struct Ins_Instit Ins;
Act_Action_t NextAction;
/***** Initializations *****/
@ -2676,7 +2676,7 @@ static void Rec_PutParamsMsgUsr (__attribute__((unused)) void *Args)
/*********************** Show institution in record card *********************/
/*****************************************************************************/
static void Rec_ShowInstitutionInHead (struct Instit *Ins,bool PutFormLinks)
static void Rec_ShowInstitutionInHead (struct Ins_Instit *Ins,bool PutFormLinks)
{
/***** Institution logo *****/
HTM_TD_Begin ("rowspan=\"4\" class=\"REC_C1_TOP CM\"");
@ -3430,7 +3430,7 @@ static void Rec_ShowComments (struct UsrData *UsrDat,bool ShowData,bool PutForm)
/************************** Show user's institution **************************/
/*****************************************************************************/
static void Rec_ShowTeacherRows (struct UsrData *UsrDat,struct Instit *Ins,
static void Rec_ShowTeacherRows (struct UsrData *UsrDat,struct Ins_Instit *Ins,
bool ShowData)
{
/***** Institution *****/
@ -3453,7 +3453,7 @@ static void Rec_ShowTeacherRows (struct UsrData *UsrDat,struct Instit *Ins,
/************************** Show user's institution **************************/
/*****************************************************************************/
static void Rec_ShowInstitution (struct Instit *Ins,bool ShowData)
static void Rec_ShowInstitution (struct Ins_Instit *Ins,bool ShowData)
{
extern const char *Txt_Institution;
@ -3487,7 +3487,7 @@ static void Rec_ShowInstitution (struct Instit *Ins,bool ShowData)
static void Rec_ShowCentre (struct UsrData *UsrDat,bool ShowData)
{
extern const char *Txt_Centre;
struct Centre Ctr;
struct Ctr_Centre Ctr;
/***** Centre *****/
HTM_TR_Begin (NULL);
@ -4083,7 +4083,7 @@ void Rec_ChgCountryOfMyInstitution (void)
void Rec_UpdateMyInstitution (void)
{
struct Instit Ins;
struct Ins_Instit Ins;
unsigned NumCtrs;
unsigned NumDpts;
@ -4121,7 +4121,7 @@ void Rec_UpdateMyInstitution (void)
void Rec_UpdateMyCentre (void)
{
struct Centre Ctr;
struct Ctr_Centre Ctr;
/***** Get my centre *****/
/* Get centre code */

View File

@ -154,7 +154,7 @@ void Rec_UpdateAndShowOtherCrsRecord (void);
unsigned long Rec_GetFieldFromCrsRecord (long UsrCod,long FieldCod,MYSQL_RES **mysql_res);
void Rec_GetFieldsCrsRecordFromForm (void);
void Rec_UpdateCrsRecord (long UsrCod);
void Rec_RemoveFieldsCrsRecordInCrs (long UsrCod,struct Course *Crs);
void Rec_RemoveFieldsCrsRecordInCrs (long UsrCod,struct Crs_Course *Crs);
void Rec_RemoveFieldsCrsRecordAll (long UsrCod);
void Rec_AllocMemFieldsRecordsCrs (void);
void Rec_FreeMemFieldsRecordsCrs (void);

View File

@ -539,7 +539,7 @@ static void Rep_WriteSectionUsrInfo (void)
extern const char *Txt_Country;
extern const char *Txt_Institution;
char CtyName[Hie_MAX_BYTES_FULL_NAME + 1];
struct Instit Ins;
struct Ins_Instit Ins;
/***** Start section *****/
fprintf (Gbl.F.Rep,"<section>"
@ -1160,8 +1160,8 @@ static void Rep_WriteRowCrsData (long CrsCod,Rol_Role_t Role,
extern const char *Txt_students_ABBREVIATION;
extern const char *Txt_unknown_removed_course;
extern const char *Txt_no_course_selected;
struct Course Crs;
struct Degree Deg;
struct Crs_Course Crs;
struct Deg_Degree Deg;
/***** Get course data *****/
Crs.CrsCod = CrsCod;

View File

@ -3467,7 +3467,7 @@ static void Sta_ShowNumHitsPerInstitution (Sta_CountType_t CountType,
static void Sta_WriteInstit (long InsCod)
{
struct Instit Ins;
struct Ins_Instit Ins;
/***** Start cell *****/
if (InsCod > 0) // Hit with an institution selected
@ -3560,7 +3560,7 @@ static void Sta_ShowNumHitsPerCentre (Sta_CountType_t CountType,
static void Sta_WriteCentre (long CtrCod)
{
struct Centre Ctr;
struct Ctr_Centre Ctr;
/***** Start cell *****/
if (CtrCod > 0) // Hit with a centre selected
@ -3653,7 +3653,7 @@ static void Sta_ShowNumHitsPerDegree (Sta_CountType_t CountType,
static void Sta_WriteDegree (long DegCod)
{
struct Degree Deg;
struct Deg_Degree Deg;
/***** Start cell *****/
if (DegCod > 0) // Hit with a degree selected
@ -3699,7 +3699,7 @@ static void Sta_ShowNumHitsPerCourse (Sta_CountType_t CountType,
struct Sta_Hits Hits;
MYSQL_ROW row;
bool CrsOK;
struct Course Crs;
struct Crs_Course Crs;
/***** Write heading *****/
HTM_TR_Begin (NULL);

View File

@ -229,8 +229,8 @@ static void SysCfg_Map (void)
unsigned Zoom;
unsigned NumCtrs;
unsigned NumCtr;
struct Centre Ctr;
struct Instit Ins;
struct Ctr_Centre Ctr;
struct Ins_Instit Ins;
/***** Leaflet CSS *****/
Map_LeafletCSS ();

View File

@ -124,7 +124,7 @@ static void TstPrn_GetAnswersFromForm (struct TstPrn_Print *Print);
static bool Tst_CheckIfNextTstAllowed (void);
static unsigned Tst_GetNumExamsGeneratedByMe (void);
static void Tst_PutFormToEditQstMedia (const struct Media *Media,int NumMediaInForm,
static void Tst_PutFormToEditQstMedia (const struct Med_Media *Media,int NumMediaInForm,
bool OptionsDisabled);
static void Tst_IncreaseMyNumAccessTst (void);
static void Tst_UpdateLastAccTst (unsigned NumQsts);
@ -204,7 +204,7 @@ static void Tst_FreeMediaOfQuestion (struct Tst_Question *Question);
static long Tst_GetMedCodFromDB (long CrsCod,long QstCod,int NumOpt);
static void Tst_GetMediaFromDB (long CrsCod,long QstCod,int NumOpt,
struct Media *Media);
struct Med_Media *Media);
static Tst_AnswerType_t Tst_ConvertFromUnsignedStrToAnsTyp (const char *UnsignedStr);
static void Tst_GetQstFromForm (struct Tst_Question *Question);
@ -842,7 +842,7 @@ void Tst_WriteQstStem (const char *Stem,const char *ClassStem,bool Visible)
/************* Put form to upload a new image for a test question ************/
/*****************************************************************************/
static void Tst_PutFormToEditQstMedia (const struct Media *Media,int NumMediaInForm,
static void Tst_PutFormToEditQstMedia (const struct Med_Media *Media,int NumMediaInForm,
bool OptionsDisabled)
{
extern const char *The_ClassFormInBox[The_NUM_THEMES];
@ -4100,7 +4100,7 @@ static long Tst_GetMedCodFromDB (long CrsCod,long QstCod,int NumOpt)
// NumOpt >= 0 ==> media associated to an answer option
static void Tst_GetMediaFromDB (long CrsCod,long QstCod,int NumOpt,
struct Media *Media)
struct Med_Media *Media)
{
/***** Get media *****/
Media->MedCod = Tst_GetMedCodFromDB (CrsCod,QstCod,NumOpt);

View File

@ -76,7 +76,7 @@ struct Tst_Question
time_t EditTime;
char *Stem;
char *Feedback;
struct Media Media;
struct Med_Media Media;
struct
{
Tst_AnswerType_t Type;
@ -88,7 +88,7 @@ struct Tst_Question
bool Correct;
char *Text;
char *Feedback;
struct Media Media;
struct Med_Media Media;
} Options[Tst_MAX_OPTIONS_PER_QUESTION];
long Integer;
double FloatingPoint[2];

View File

@ -92,6 +92,7 @@
#include "swad_test.h"
#include "swad_test_visibility.h"
#include "swad_timeline.h"
#include "swad_timeline_note.h"
#include "swad_timetable.h"
#include "swad_user.h"
@ -52546,7 +52547,7 @@ const char *Txt_Timeline_OF_A_USER = // Warning: it is very important to include
#endif
const char *Txt_TIMELINE_NOTE[TL_NUM_NOTE_TYPES] =
const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
{
[TL_NOTE_UNKNOWN] =
#if L==1 // ca

File diff suppressed because it is too large Load Diff

View File

@ -27,6 +27,11 @@
/********************************** Headers **********************************/
/*****************************************************************************/
#include "swad_form.h"
#include "swad_media.h"
#include "swad_notification.h"
#include "swad_user.h"
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
@ -38,40 +43,21 @@
#define TL_DEF_USRS_SHOWN 5 // Default maximum number of users shown who have share/fav a note
#define TL_MAX_USRS_SHOWN 1000 // Top maximum number of users shown who have share/fav a note
/*
Timeline images will be saved with:
· maximum width of TL_IMAGE_SAVED_MAX_HEIGHT
· maximum height of TL_IMAGE_SAVED_MAX_HEIGHT
· maintaining the original aspect ratio (aspect ratio recommended: 3:2)
*/
#define TL_IMAGE_SAVED_MAX_WIDTH 768
#define TL_IMAGE_SAVED_MAX_HEIGHT 768
#define TL_IMAGE_SAVED_QUALITY 90 // 1 to 100
// in timeline posts, the quality should not be high in order to speed up the loading of images
/*****************************************************************************/
/******************************** Public types *******************************/
/*****************************************************************************/
#define TL_NUM_NOTE_TYPES 13
// If the numbers assigned to each event type change,
// it is necessary to change old numbers to new ones in database table tl_notes
typedef enum
{
TL_NOTE_UNKNOWN = 0,
/* Start tab */
TL_NOTE_POST = 10, // Post written directly in timeline
/* Institution tab */
TL_NOTE_INS_DOC_PUB_FILE = 1, // Public file in documents of institution
TL_NOTE_INS_SHA_PUB_FILE = 2, // Public file in shared files of institution
/* Centre tab */
TL_NOTE_CTR_DOC_PUB_FILE = 3, // Public file in documents of centre
TL_NOTE_CTR_SHA_PUB_FILE = 4, // Public file in shared files of centre
/* Degree tab */
TL_NOTE_DEG_DOC_PUB_FILE = 5, // Public file in documents of degree
TL_NOTE_DEG_SHA_PUB_FILE = 6, // Public file in shared files of degree
/* Course tab */
TL_NOTE_CRS_DOC_PUB_FILE = 7, // Public file in documents of course
TL_NOTE_CRS_SHA_PUB_FILE = 8, // Public file in shared files of course
/* Assessment tab */
TL_NOTE_EXAM_ANNOUNCEMENT = 9, // Exam announcement in a course
/* Users tab */
/* Messages tab */
TL_NOTE_NOTICE = 12, // A public notice in a course
TL_NOTE_FORUM_POST = 11, // Post in global/swad forums
/* Analytics tab */
/* Profile tab */
} TL_NoteType_t;
#define TL_NUM_TOP_MESSAGES (1 + 6)
typedef enum
{
@ -144,40 +130,37 @@ struct TL_Publication
struct TL_PostContent
{
char Txt[Cns_MAX_BYTES_LONG_TEXT + 1];
struct Media Media;
struct Med_Media Media;
};
struct TL_Note
typedef enum
{
long NotCod; // Unique code/identifier for each note
TL_NoteType_t NoteType; // Timeline post, public file, exam announcement, notice, forum post...
long UsrCod; // Publisher
long HieCod; // Hierarchy code (institution/centre/degree/course)
long Cod; // Code of file, forum post, notice, timeline post...
bool Unavailable; // File, forum post, notice,... unavailable (removed)
time_t DateTimeUTC; // Date-time of publication in UTC time
unsigned NumShared; // Number of times (users) this note has been shared
unsigned NumFavs; // Number of times (users) this note has been favourited
};
TL_DONT_HIGHLIGHT,
TL_HIGHLIGHT,
} TL_Highlight_t;
struct TL_Comment
typedef enum
{
long PubCod; // Unique code/identifier for each publication
long UsrCod; // Publisher
long NotCod; // Note code to which this comment belongs
time_t DateTimeUTC; // Date-time of publication in UTC time
unsigned NumFavs; // Number of times (users) this comment has been favourited
struct TL_PostContent Content;
};
TL_DONT_SHOW_ALONE,
TL_SHOW_ALONE,
} TL_ShowAlone_t;
/*****************************************************************************/
/****************************** Public prototypes ****************************/
/*****************************************************************************/
void TL_InitTimelineGbl (struct TL_Timeline *Timeline);
void TL_ResetTimeline (struct TL_Timeline *Timeline);
void TL_ShowTimelineGbl (void);
void TL_ShowNoteAndTimelineGbl (struct TL_Timeline *Timeline);
void TL_ShowTimelineGblHighlightingNot (struct TL_Timeline *Timeline,
long NotCod);
void TL_ShowTimelineUsr (struct TL_Timeline *Timeline);
void TL_ShowTimelineUsrHighlightingNot (struct TL_Timeline *Timeline,
long NotCod);
void TL_RefreshNewTimelineGbl (void);
@ -186,44 +169,35 @@ void TL_RefreshOldTimelineUsr (void);
void TL_MarkMyNotifAsSeen (void);
void TL_FormStart (const struct TL_Timeline *Timeline,
Act_Action_t ActionGbl,
Act_Action_t ActionUsr);
void TL_GetParamWho (void);
Usr_Who_t TL_GetGlobalWho (void);
void TL_StoreAndPublishNote (TL_NoteType_t NoteType,long Cod);
void TL_MarkNoteAsUnavailable (TL_NoteType_t NoteType,long Cod);
void TL_MarkNoteOneFileAsUnavailable (const char *Path);
void TL_MarkNotesChildrenOfFolderAsUnavailable (const char *Path);
void TL_WriteTopMessage (TL_TopMessage_t TopMessage,long PublisherCod);
void TL_PublishNoteInTimeline (struct TL_Publication *Pub);
void TL_WriteDateTime (time_t TimeUTC);
void TL_GetAndWritePost (long PstCod);
void TL_PublishPubInTimeline (struct TL_Publication *Pub);
void TL_PutTextarea (const char *Placeholder,const char *ClassTextArea);
void TL_ReceivePostUsr (void);
void TL_ReceivePostGbl (void);
void TL_ShowHiddenCommentsUsr (void);
void TL_ShowHiddenCommentsGbl (void);
void TL_Com_ShowHiddenCommentsUsr (void);
void TL_Com_ShowHiddenCommentsGbl (void);
void TL_PutHiddenParamPubCod (long PubCod);
long TL_GetParamNotCod (void);
long TL_GetParamPubCod (void);
void TL_ReceiveCommentUsr (void);
void TL_ReceiveCommentGbl (void);
void TL_CreateNotifToAuthor (long AuthorCod,long PubCod,
Ntf_NotifyEvent_t NotifyEvent);
void TL_RequestRemNoteUsr (void);
void TL_RequestRemNoteGbl (void);
void TL_RemoveNoteUsr (void);
void TL_RemoveNoteGbl (void);
long TL_GetPubCodOfOriginalNote (long NotCod);
void TL_RequestRemComUsr (void);
void TL_RequestRemComGbl (void);
void TL_RemoveComUsr (void);
void TL_RemoveComGbl (void);
void TL_RemoveUsrContent (long UsrCod);
void TL_ShowNumSharersOrFavers (unsigned NumUsrs);
@ -236,9 +210,6 @@ void TL_FormFavSha (Act_Action_t ActionGbl,Act_Action_t ActionUsr,
const char *ParamFormat,long ParamCod,
const char *Icon,const char *Title);
void TL_GetDataOfNoteByCod (struct TL_Note *Not);
void TL_GetDataOfCommByCod (struct TL_Comment *Com);
void TL_ClearOldTimelinesDB (void);
void TL_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],

1154
swad_timeline_comment.c Normal file

File diff suppressed because it is too large Load Diff

81
swad_timeline_comment.h Normal file
View File

@ -0,0 +1,81 @@
// swad_timeline.h: social timeline
#ifndef _SWAD_TL_COM
#define _SWAD_TL_COM
/*
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-2021 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 <http://www.gnu.org/licenses/>.
*/
/*****************************************************************************/
/********************************** Headers **********************************/
/*****************************************************************************/
#include "swad_timeline_note.h"
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
/*****************************************************************************/
/******************************** Public types *******************************/
/*****************************************************************************/
struct TL_Com_Comment
{
long PubCod; // Unique code/identifier for each publication
long UsrCod; // Publisher
long NotCod; // Note code to which this comment belongs
time_t DateTimeUTC; // Date-time of publication in UTC time
unsigned NumFavs; // Number of times (users) this comment has been favourited
struct TL_PostContent Content;
};
/*****************************************************************************/
/****************************** Public prototypes ****************************/
/*****************************************************************************/
void TL_Com_PutIconToToggleComment (const char UniqueId[Frm_MAX_BYTES_ID + 1]);
void TL_Com_PutIconCommentDisabled (void);
void TL_Com_PutHiddenFormToWriteNewComment (const struct TL_Timeline *Timeline,
long NotCod,
const char IdNewComment[Frm_MAX_BYTES_ID + 1]);
unsigned long TL_Com_GetNumCommentsInNote (long NotCod);
void TL_Com_WriteCommentsInNote (struct TL_Timeline *Timeline,
const struct TL_Not_Note *Not,
unsigned NumComments);
void TL_Com_ShowHiddenCommentsUsr (void);
void TL_Com_ShowHiddenCommentsGbl (void);
void TL_Com_ReceiveCommentUsr (void);
void TL_Com_ReceiveCommentGbl (void);
void TL_Com_RequestRemComUsr (void);
void TL_Com_RequestRemComGbl (void);
void TL_Com_RemoveComUsr (void);
void TL_Com_RemoveComGbl (void);
void TL_Com_RemoveCommentMediaAndDBEntries (long PubCod);
void TL_Com_GetDataOfCommByCod (struct TL_Com_Comment *Com);
#endif

View File

@ -63,18 +63,18 @@ static void TL_Fav_PutFormToUnfNote (long ParamCod);
static void TL_Fav_PutFormToFavComment (long ParamCod);
static void TL_Fav_PutFormToUnfComment (long ParamCod);
static void TL_Fav_FavNote (struct TL_Note *Not);
static void TL_Fav_UnfNote (struct TL_Note *Not);
static void TL_Fav_FavNote (struct TL_Not_Note *Not);
static void TL_Fav_UnfNote (struct TL_Not_Note *Not);
static void TL_Fav_FavComment (struct TL_Comment *Com);
static void TL_Fav_UnfComment (struct TL_Comment *Com);
static void TL_Fav_FavComment (struct TL_Com_Comment *Com);
static void TL_Fav_UnfComment (struct TL_Com_Comment *Com);
static bool TL_Fav_CheckIfNoteIsFavedByUsr (long NotCod,long UsrCod);
static bool TL_Fav_CheckIfCommIsFavedByUsr (long PubCod,long UsrCod);
static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *Not,
static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Not_Note *Not,
TL_HowManyUsrs_t HowManyUsrs);
static void TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *Com,
static void TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Com_Comment *Com,
TL_HowManyUsrs_t HowManyUsrs);
/*****************************************************************************/
@ -162,11 +162,11 @@ void TL_Fav_ShowAllFaversNoteUsr (void)
void TL_Fav_ShowAllFaversNoteGbl (void)
{
struct TL_Note Not;
struct TL_Not_Note Not;
/***** Get data of note *****/
Not.NotCod = TL_GetParamNotCod ();
TL_GetDataOfNoteByCod (&Not);
Not.NotCod = TL_Not_GetParamNotCod ();
TL_Not_GetDataOfNoteByCod (&Not);
/***** Write HTML inside DIV with form to fav/unfav *****/
TL_Fav_PutFormToFavUnfNote (&Not,TL_SHOW_ALL_USRS);
@ -183,7 +183,7 @@ void TL_Fav_FavNoteUsr (void)
void TL_Fav_FavNoteGbl (void)
{
struct TL_Note Not;
struct TL_Not_Note Not;
/***** Mark note as favourite *****/
TL_Fav_FavNote (&Not);
@ -203,7 +203,7 @@ void TL_Fav_UnfNoteUsr (void)
void TL_Fav_UnfNoteGbl (void)
{
struct TL_Note Not;
struct TL_Not_Note Not;
/***** Stop marking as favourite a previously favourited note *****/
TL_Fav_UnfNote (&Not);
@ -212,7 +212,7 @@ void TL_Fav_UnfNoteGbl (void)
TL_Fav_PutFormToFavUnfNote (&Not,TL_SHOW_FEW_USRS);
}
void TL_Fav_PutFormToFavUnfNote (const struct TL_Note *Not,
void TL_Fav_PutFormToFavUnfNote (const struct TL_Not_Note *Not,
TL_HowManyUsrs_t HowManyUsrs)
{
bool IAmTheAuthor;
@ -241,14 +241,14 @@ void TL_Fav_PutFormToFavUnfNote (const struct TL_Note *Not,
TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (Not,HowManyUsrs);
}
static void TL_Fav_FavNote (struct TL_Note *Not)
static void TL_Fav_FavNote (struct TL_Not_Note *Not)
{
bool ItsMe;
long OriginalPubCod;
/***** Get data of note *****/
Not->NotCod = TL_GetParamNotCod ();
TL_GetDataOfNoteByCod (Not);
Not->NotCod = TL_Not_GetParamNotCod ();
TL_Not_GetDataOfNoteByCod (Not);
if (Not->NotCod > 0)
{
@ -271,21 +271,21 @@ static void TL_Fav_FavNote (struct TL_Note *Not)
/***** Create notification about favourite post
for the author of the post *****/
OriginalPubCod = TL_GetPubCodOfOriginalNote (Not->NotCod);
OriginalPubCod = TL_Not_GetPubCodOfOriginalNote (Not->NotCod);
if (OriginalPubCod > 0)
TL_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TIMELINE_FAV);
}
}
}
static void TL_Fav_UnfNote (struct TL_Note *Not)
static void TL_Fav_UnfNote (struct TL_Not_Note *Not)
{
long OriginalPubCod;
bool ItsMe;
/***** Get data of note *****/
Not->NotCod = TL_GetParamNotCod ();
TL_GetDataOfNoteByCod (Not);
Not->NotCod = TL_Not_GetParamNotCod ();
TL_Not_GetDataOfNoteByCod (Not);
if (Not->NotCod > 0)
{
@ -306,7 +306,7 @@ static void TL_Fav_UnfNote (struct TL_Note *Not)
TL_Fav_GetNumTimesANoteHasBeenFav (Not);
/***** Mark possible notifications on this note as removed *****/
OriginalPubCod = TL_GetPubCodOfOriginalNote (Not->NotCod);
OriginalPubCod = TL_Not_GetPubCodOfOriginalNote (Not->NotCod);
if (OriginalPubCod > 0)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,OriginalPubCod);
}
@ -328,12 +328,12 @@ void TL_Fav_ShowAllFaversComUsr (void)
void TL_Fav_ShowAllFaversComGbl (void)
{
struct TL_Comment Com;
struct TL_Com_Comment Com;
/***** Get data of comment *****/
Med_MediaConstructor (&Com.Content.Media);
Com.PubCod = TL_GetParamPubCod ();
TL_GetDataOfCommByCod (&Com);
TL_Com_GetDataOfCommByCod (&Com);
Med_MediaDestructor (&Com.Content.Media);
/***** Write HTML inside DIV with form to fav/unfav *****/
@ -351,7 +351,7 @@ void TL_Fav_FavCommentUsr (void)
void TL_Fav_FavCommentGbl (void)
{
struct TL_Comment Com;
struct TL_Com_Comment Com;
/***** Mark comment as favourite *****/
TL_Fav_FavComment (&Com);
@ -371,7 +371,7 @@ void TL_Fav_UnfCommentUsr (void)
void TL_Fav_UnfCommentGbl (void)
{
struct TL_Comment Com;
struct TL_Com_Comment Com;
/***** Stop marking as favourite a previously favourited comment *****/
TL_Fav_UnfComment (&Com);
@ -380,7 +380,7 @@ void TL_Fav_UnfCommentGbl (void)
TL_Fav_PutFormToFavUnfComment (&Com,TL_SHOW_FEW_USRS);
}
void TL_Fav_PutFormToFavUnfComment (const struct TL_Comment *Com,
void TL_Fav_PutFormToFavUnfComment (const struct TL_Com_Comment *Com,
TL_HowManyUsrs_t HowManyUsrs)
{
bool IAmTheAuthor;
@ -410,7 +410,7 @@ void TL_Fav_PutFormToFavUnfComment (const struct TL_Comment *Com,
TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (Com,HowManyUsrs);
}
static void TL_Fav_FavComment (struct TL_Comment *Com)
static void TL_Fav_FavComment (struct TL_Com_Comment *Com)
{
bool IAmTheAuthor;
@ -419,7 +419,7 @@ static void TL_Fav_FavComment (struct TL_Comment *Com)
/***** Get data of comment *****/
Com->PubCod = TL_GetParamPubCod ();
TL_GetDataOfCommByCod (Com);
TL_Com_GetDataOfCommByCod (Com);
if (Com->PubCod > 0)
{
@ -450,7 +450,7 @@ static void TL_Fav_FavComment (struct TL_Comment *Com)
Med_MediaDestructor (&Com->Content.Media);
}
static void TL_Fav_UnfComment (struct TL_Comment *Com)
static void TL_Fav_UnfComment (struct TL_Com_Comment *Com)
{
bool IAmTheAuthor;
@ -459,7 +459,7 @@ static void TL_Fav_UnfComment (struct TL_Comment *Com)
/***** Get data of comment *****/
Com->PubCod = TL_GetParamPubCod ();
TL_GetDataOfCommByCod (Com);
TL_Com_GetDataOfCommByCod (Com);
if (Com->PubCod > 0)
{
@ -518,7 +518,7 @@ static bool TL_Fav_CheckIfCommIsFavedByUsr (long PubCod,long UsrCod)
/*************** Get number of times a note has been favourited **************/
/*****************************************************************************/
void TL_Fav_GetNumTimesANoteHasBeenFav (struct TL_Note *Not)
void TL_Fav_GetNumTimesANoteHasBeenFav (struct TL_Not_Note *Not)
{
/***** Get number of times (users) this note has been favourited *****/
Not->NumFavs =
@ -535,7 +535,7 @@ void TL_Fav_GetNumTimesANoteHasBeenFav (struct TL_Note *Not)
/************ Get number of times a comment has been favourited **************/
/*****************************************************************************/
void TL_Fav_GetNumTimesACommHasBeenFav (struct TL_Comment *Com)
void TL_Fav_GetNumTimesACommHasBeenFav (struct TL_Com_Comment *Com)
{
/***** Get number of times (users) this comment has been favourited *****/
Com->NumFavs =
@ -552,7 +552,7 @@ void TL_Fav_GetNumTimesACommHasBeenFav (struct TL_Comment *Com)
/************ Show users who have marked this note as favourite **************/
/*****************************************************************************/
static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *Not,
static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Not_Note *Not,
TL_HowManyUsrs_t HowManyUsrs)
{
MYSQL_RES *mysql_res;
@ -599,7 +599,7 @@ static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *Not,
/************ Show users who have marked this note as favourite **************/
/*****************************************************************************/
static void TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *Com,
static void TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Com_Comment *Com,
TL_HowManyUsrs_t HowManyUsrs)
{
MYSQL_RES *mysql_res;

View File

@ -27,6 +27,9 @@
/********************************** Headers **********************************/
/*****************************************************************************/
#include "swad_timeline_comment.h"
#include "swad_timeline_note.h"
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
@ -50,7 +53,7 @@ void TL_Fav_FavNoteUsr (void);
void TL_Fav_FavNoteGbl (void);
void TL_Fav_UnfNoteUsr (void);
void TL_Fav_UnfNoteGbl (void);
void TL_Fav_PutFormToFavUnfNote (const struct TL_Note *Not,
void TL_Fav_PutFormToFavUnfNote (const struct TL_Not_Note *Not,
TL_HowManyUsrs_t HowManyUsrs);
void TL_Fav_ShowAllFaversComUsr (void);
@ -59,10 +62,10 @@ void TL_Fav_FavCommentUsr (void);
void TL_Fav_FavCommentGbl (void);
void TL_Fav_UnfCommentUsr (void);
void TL_Fav_UnfCommentGbl (void);
void TL_Fav_PutFormToFavUnfComment (const struct TL_Comment *Com,
void TL_Fav_PutFormToFavUnfComment (const struct TL_Com_Comment *Com,
TL_HowManyUsrs_t HowManyUsrs);
void TL_Fav_GetNumTimesANoteHasBeenFav (struct TL_Note *Not);
void TL_Fav_GetNumTimesACommHasBeenFav (struct TL_Comment *Com);
void TL_Fav_GetNumTimesANoteHasBeenFav (struct TL_Not_Note *Not);
void TL_Fav_GetNumTimesACommHasBeenFav (struct TL_Com_Comment *Com);
#endif

1311
swad_timeline_note.c Normal file

File diff suppressed because it is too large Load Diff

124
swad_timeline_note.h Normal file
View File

@ -0,0 +1,124 @@
// swad_timeline_note.h: social timeline notes
#ifndef _SWAD_TL_NOT
#define _SWAD_TL_NOT
/*
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-2021 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 <http://www.gnu.org/licenses/>.
*/
/*****************************************************************************/
/********************************** Headers **********************************/
/*****************************************************************************/
#include "swad_timeline.h"
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
/*****************************************************************************/
/******************************** Public types *******************************/
/*****************************************************************************/
#define TL_NOT_NUM_NOTE_TYPES 13
// If the numbers assigned to each event type change,
// it is necessary to change old numbers to new ones in database table tl_notes
typedef enum
{
TL_NOTE_UNKNOWN = 0,
/* Start tab */
TL_NOTE_POST = 10, // Post written directly in timeline
/* Institution tab */
TL_NOTE_INS_DOC_PUB_FILE = 1, // Public file in documents of institution
TL_NOTE_INS_SHA_PUB_FILE = 2, // Public file in shared files of institution
/* Centre tab */
TL_NOTE_CTR_DOC_PUB_FILE = 3, // Public file in documents of centre
TL_NOTE_CTR_SHA_PUB_FILE = 4, // Public file in shared files of centre
/* Degree tab */
TL_NOTE_DEG_DOC_PUB_FILE = 5, // Public file in documents of degree
TL_NOTE_DEG_SHA_PUB_FILE = 6, // Public file in shared files of degree
/* Course tab */
TL_NOTE_CRS_DOC_PUB_FILE = 7, // Public file in documents of course
TL_NOTE_CRS_SHA_PUB_FILE = 8, // Public file in shared files of course
/* Assessment tab */
TL_NOTE_EXAM_ANNOUNCEMENT = 9, // Exam announcement in a course
/* Users tab */
/* Messages tab */
TL_NOTE_NOTICE = 12, // A public notice in a course
TL_NOTE_FORUM_POST = 11, // Post in global/swad forums
/* Analytics tab */
/* Profile tab */
} TL_Not_NoteType_t;
struct TL_Not_Note
{
long NotCod; // Unique code/identifier for each note
TL_Not_NoteType_t NoteType; // Timeline post, public file, exam announcement, notice, forum post...
long UsrCod; // Publisher
long HieCod; // Hierarchy code (institution/centre/degree/course)
long Cod; // Code of file, forum post, notice, timeline post...
bool Unavailable; // File, forum post, notice,... unavailable (removed)
time_t DateTimeUTC; // Date-time of publication in UTC time
unsigned NumShared; // Number of times (users) this note has been shared
unsigned NumFavs; // Number of times (users) this note has been favourited
};
/*****************************************************************************/
/****************************** Public prototypes ****************************/
/*****************************************************************************/
void TL_Not_ShowHighlightedNote (struct TL_Timeline *Timeline,
struct TL_Not_Note *Not);
void TL_Not_InsertNoteInJustRetrievedNotes (long NotCod);
void TL_Not_InsertNoteInVisibleTimeline (long NotCod);
void TL_Not_WriteNote (struct TL_Timeline *Timeline,
const struct TL_Not_Note *Not,
TL_TopMessage_t TopMessage,
long PublisherCod, // Who did the action (publication, commenting, faving, sharing, mentioning)
TL_Highlight_t Highlight, // Highlight note
TL_ShowAlone_t ShowNoteAlone); // Note is shown alone, not in a list
void TL_Not_WriteAuthorNote (const struct UsrData *UsrDat);
void TL_Not_GetNoteSummary (const struct TL_Not_Note *Not,
char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1]);
void TL_Not_StoreAndPublishNote (TL_Not_NoteType_t NoteType,long Cod);
void TL_Not_StoreAndPublishNoteInternal (TL_Not_NoteType_t NoteType,long Cod,struct TL_Publication *Pub);
void TL_Not_MarkNoteAsUnavailable (TL_Not_NoteType_t NoteType,long Cod);
void TL_Not_MarkNoteOneFileAsUnavailable (const char *Path);
void TL_Not_MarkNotesChildrenOfFolderAsUnavailable (const char *Path);
void TL_Not_PutHiddenParamNotCod (long NotCod);
long TL_Not_GetParamNotCod (void);
void TL_Not_RequestRemNoteUsr (void);
void TL_Not_RequestRemNoteGbl (void);
void TL_Not_RemoveNoteUsr (void);
void TL_Not_RemoveNoteGbl (void);
void TL_Not_AddNotesJustRetrievedToTimelineThisSession (void);
long TL_Not_GetPubCodOfOriginalNote (long NotCod);
void TL_Not_GetDataOfNoteByCod (struct TL_Not_Note *Not);
#endif

View File

@ -60,12 +60,12 @@ static void TL_Sha_PutDisabledIconShare (unsigned NumShared);
static void TL_Sha_PutFormToShaNote (long ParamCod);
static void TL_Sha_PutFormToUnsNote (long ParamCod);
static void TL_Sha_ShaNote (struct TL_Note *Not);
static void TL_Sha_UnsNote (struct TL_Note *Not);
static void TL_Sha_ShaNote (struct TL_Not_Note *Not);
static void TL_Sha_UnsNote (struct TL_Not_Note *Not);
static bool TL_Sha_CheckIfNoteIsSharedByUsr (long NotCod,long UsrCod);
static void TL_Sha_ShowUsrsWhoHaveSharedNote (const struct TL_Note *Not,
static void TL_Sha_ShowUsrsWhoHaveSharedNote (const struct TL_Not_Note *Not,
TL_HowManyUsrs_t HowManyUsrs);
/*****************************************************************************/
@ -129,11 +129,11 @@ void TL_Sha_ShowAllSharersNoteUsr (void)
void TL_Sha_ShowAllSharersNoteGbl (void)
{
struct TL_Note Not;
struct TL_Not_Note Not;
/***** Get data of note *****/
Not.NotCod = TL_GetParamNotCod ();
TL_GetDataOfNoteByCod (&Not);
Not.NotCod = TL_Not_GetParamNotCod ();
TL_Not_GetDataOfNoteByCod (&Not);
/***** Write HTML inside DIV with form to share/unshare *****/
TL_Sha_PutFormToShaUnsNote (&Not,TL_SHOW_ALL_USRS);
@ -150,7 +150,7 @@ void TL_Sha_ShaNoteUsr (void)
void TL_Sha_ShaNoteGbl (void)
{
struct TL_Note Not;
struct TL_Not_Note Not;
/***** Share note *****/
TL_Sha_ShaNote (&Not);
@ -159,7 +159,7 @@ void TL_Sha_ShaNoteGbl (void)
TL_Sha_PutFormToShaUnsNote (&Not,TL_SHOW_FEW_USRS);
}
static void TL_Sha_ShaNote (struct TL_Note *Not)
static void TL_Sha_ShaNote (struct TL_Not_Note *Not)
{
// extern const char *Txt_The_original_post_no_longer_exists;
struct TL_Publication Pub;
@ -167,28 +167,28 @@ static void TL_Sha_ShaNote (struct TL_Note *Not)
long OriginalPubCod;
/***** Get data of note *****/
Not->NotCod = TL_GetParamNotCod ();
TL_GetDataOfNoteByCod (Not);
Not->NotCod = TL_Not_GetParamNotCod ();
TL_Not_GetDataOfNoteByCod (Not);
if (Not->NotCod > 0)
{
ItsMe = Usr_ItsMe (Not->UsrCod);
if (Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author
if (!TL_Sha_CheckIfNoteIsSharedByUsr (Not->NotCod,
Gbl.Usrs.Me.UsrDat.UsrCod)) // Not yet shared by me
Gbl.Usrs.Me.UsrDat.UsrCod)) // Not yet shared by me
{
/***** Share (publish note in timeline) *****/
Pub.NotCod = Not->NotCod;
Pub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod;
Pub.PubType = TL_PUB_SHARED_NOTE;
TL_PublishNoteInTimeline (&Pub); // Set Pub.PubCod
TL_PublishPubInTimeline (&Pub); // Set Pub.PubCod
/* Update number of times this note is shared */
TL_Sha_UpdateNumTimesANoteHasBeenShared (Not);
/**** Create notification about shared post
for the author of the post ***/
OriginalPubCod = TL_GetPubCodOfOriginalNote (Not->NotCod);
OriginalPubCod = TL_Not_GetPubCodOfOriginalNote (Not->NotCod);
if (OriginalPubCod > 0)
TL_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TIMELINE_SHARE);
}
@ -210,7 +210,7 @@ void TL_Sha_UnsNoteUsr (void)
void TL_Sha_UnsNoteGbl (void)
{
struct TL_Note Not;
struct TL_Not_Note Not;
/***** Unshare note *****/
TL_Sha_UnsNote (&Not);
@ -219,15 +219,15 @@ void TL_Sha_UnsNoteGbl (void)
TL_Sha_PutFormToShaUnsNote (&Not,TL_SHOW_FEW_USRS);
}
static void TL_Sha_UnsNote (struct TL_Note *Not)
static void TL_Sha_UnsNote (struct TL_Not_Note *Not)
{
// extern const char *Txt_The_original_post_no_longer_exists;
long OriginalPubCod;
bool ItsMe;
/***** Get data of note *****/
Not->NotCod = TL_GetParamNotCod ();
TL_GetDataOfNoteByCod (Not);
Not->NotCod = TL_Not_GetParamNotCod ();
TL_Not_GetDataOfNoteByCod (Not);
if (Not->NotCod > 0)
{
@ -251,14 +251,14 @@ static void TL_Sha_UnsNote (struct TL_Note *Not)
TL_Sha_UpdateNumTimesANoteHasBeenShared (Not);
/***** Mark possible notifications on this note as removed *****/
OriginalPubCod = TL_GetPubCodOfOriginalNote (Not->NotCod);
OriginalPubCod = TL_Not_GetPubCodOfOriginalNote (Not->NotCod);
if (OriginalPubCod > 0)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_SHARE,OriginalPubCod);
}
}
}
void TL_Sha_PutFormToShaUnsNote (const struct TL_Note *Not,
void TL_Sha_PutFormToShaUnsNote (const struct TL_Not_Note *Not,
TL_HowManyUsrs_t HowManyUsrs)
{
bool IAmTheAuthor;
@ -307,7 +307,7 @@ static bool TL_Sha_CheckIfNoteIsSharedByUsr (long NotCod,long UsrCod)
/********** Get number of times a note has been shared in timeline ***********/
/*****************************************************************************/
void TL_Sha_UpdateNumTimesANoteHasBeenShared (struct TL_Note *Not)
void TL_Sha_UpdateNumTimesANoteHasBeenShared (struct TL_Not_Note *Not)
{
/***** Get number of times (users) this note has been shared *****/
Not->NumShared =
@ -326,7 +326,7 @@ void TL_Sha_UpdateNumTimesANoteHasBeenShared (struct TL_Note *Not)
/******************* Show users who have shared this note ********************/
/*****************************************************************************/
static void TL_Sha_ShowUsrsWhoHaveSharedNote (const struct TL_Note *Not,
static void TL_Sha_ShowUsrsWhoHaveSharedNote (const struct TL_Not_Note *Not,
TL_HowManyUsrs_t HowManyUsrs)
{
MYSQL_RES *mysql_res;

View File

@ -27,6 +27,8 @@
/********************************** Headers **********************************/
/*****************************************************************************/
#include "swad_timeline_note.h"
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
@ -45,9 +47,9 @@ void TL_Sha_ShaNoteUsr (void);
void TL_Sha_ShaNoteGbl (void);
void TL_Sha_UnsNoteUsr (void);
void TL_Sha_UnsNoteGbl (void);
void TL_Sha_PutFormToShaUnsNote (const struct TL_Note *Not,
void TL_Sha_PutFormToShaUnsNote (const struct TL_Not_Note *Not,
TL_HowManyUsrs_t HowManyUsrs);
void TL_Sha_UpdateNumTimesANoteHasBeenShared (struct TL_Note *Not);
void TL_Sha_UpdateNumTimesANoteHasBeenShared (struct TL_Not_Note *Not);
#endif

View File

@ -1492,7 +1492,7 @@ static void TT_TimeTableDrawCell (const struct TT_Timetable *Timetable,
char *ColSpanStr;
char *ClassStr;
TT_ClassType_t CT;
struct Course Crs;
struct Crs_Course Crs;
struct GroupType *GrpTyp;
struct Group *Grp;
char *Room;

View File

@ -3585,7 +3585,7 @@ void Usr_WriteRowUsrMainData (unsigned NumUsr,struct UsrData *UsrDat,
bool ShowPhoto;
bool UsrIsTheMsgSender = PutCheckBoxToSelectUsr &&
(UsrDat->UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod);
struct Instit Ins;
struct Ins_Instit Ins;
/***** Start row *****/
HTM_TR_Begin (NULL);
@ -3673,8 +3673,8 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat)
{
char PhotoURL[PATH_MAX + 1];
bool ShowPhoto;
struct Instit Ins;
struct Centre Ctr;
struct Ins_Instit Ins;
struct Ctr_Centre Ctr;
struct Dpt_Department Dpt;
/***** Start row *****/
@ -3762,7 +3762,7 @@ static void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames)
MYSQL_RES *mysql_res;
MYSQL_ROW row;
char Text[Cns_MAX_BYTES_TEXT + 1];
struct Instit Ins;
struct Ins_Instit Ins;
bool ShowData = (Gbl.Usrs.Me.Role.Logged == Rol_TCH && UsrDat->Accepted) ||
Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM;
@ -3863,12 +3863,12 @@ static void Usr_WriteRowTchAllData (struct UsrData *UsrDat)
{
char PhotoURL[PATH_MAX + 1];
bool ShowPhoto;
struct Instit Ins;
struct Ins_Instit Ins;
bool ItsMe = Usr_ItsMe (UsrDat->UsrCod);
bool ShowData = (ItsMe || UsrDat->Accepted ||
Gbl.Usrs.Me.Role.Logged == Rol_DEG_ADM ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM);
struct Centre Ctr;
struct Ctr_Centre Ctr;
struct Dpt_Department Dpt;
/***** Start row *****/
@ -3941,7 +3941,7 @@ static void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat)
{
char PhotoURL[PATH_MAX + 1];
bool ShowPhoto;
struct Instit Ins;
struct Ins_Instit Ins;
/***** Start row *****/
HTM_TR_Begin (NULL);
@ -4307,7 +4307,7 @@ void Usr_FlushCacheNumUsrsWhoClaimToBelongToIns (void)
Gbl.Cache.NumUsrsWhoClaimToBelongToIns.NumUsrs = 0;
}
unsigned Usr_GetNumUsrsWhoClaimToBelongToIns (struct Instit *Ins)
unsigned Usr_GetNumUsrsWhoClaimToBelongToIns (struct Ins_Instit *Ins)
{
/***** 1. Fast check: Trivial case *****/
if (Ins->InsCod <= 0)
@ -4340,7 +4340,7 @@ unsigned Usr_GetNumUsrsWhoClaimToBelongToIns (struct Instit *Ins)
return Ins->NumUsrsWhoClaimToBelongToIns.NumUsrs;
}
unsigned Usr_GetCachedNumUsrsWhoClaimToBelongToIns (struct Instit *Ins)
unsigned Usr_GetCachedNumUsrsWhoClaimToBelongToIns (struct Ins_Instit *Ins)
{
unsigned NumUsrsIns;
@ -4363,7 +4363,7 @@ void Usr_FlushCacheNumUsrsWhoClaimToBelongToCtr (void)
Gbl.Cache.NumUsrsWhoClaimToBelongToCtr.NumUsrs = 0;
}
unsigned Usr_GetNumUsrsWhoClaimToBelongToCtr (struct Centre *Ctr)
unsigned Usr_GetNumUsrsWhoClaimToBelongToCtr (struct Ctr_Centre *Ctr)
{
/***** 1. Fast check: Trivial case *****/
if (Ctr->CtrCod <= 0)
@ -4395,7 +4395,7 @@ unsigned Usr_GetNumUsrsWhoClaimToBelongToCtr (struct Centre *Ctr)
return Ctr->NumUsrsWhoClaimToBelongToCtr.NumUsrs;
}
unsigned Usr_GetCachedNumUsrsWhoClaimToBelongToCtr (struct Centre *Ctr)
unsigned Usr_GetCachedNumUsrsWhoClaimToBelongToCtr (struct Ctr_Centre *Ctr)
{
unsigned NumUsrsCtr;

View File

@ -421,12 +421,12 @@ unsigned Usr_GetNumUsrsWhoClaimToBelongToCty (struct Country *Cty);
unsigned Usr_GetCachedNumUsrsWhoClaimToBelongToCty (struct Country *Cty);
void Usr_FlushCacheNumUsrsWhoClaimToBelongToIns (void);
unsigned Usr_GetNumUsrsWhoClaimToBelongToIns (struct Instit *Ins);
unsigned Usr_GetCachedNumUsrsWhoClaimToBelongToIns (struct Instit *Ins);
unsigned Usr_GetNumUsrsWhoClaimToBelongToIns (struct Ins_Instit *Ins);
unsigned Usr_GetCachedNumUsrsWhoClaimToBelongToIns (struct Ins_Instit *Ins);
void Usr_FlushCacheNumUsrsWhoClaimToBelongToCtr (void);
unsigned Usr_GetNumUsrsWhoClaimToBelongToCtr (struct Centre *Ctr);
unsigned Usr_GetCachedNumUsrsWhoClaimToBelongToCtr (struct Centre *Ctr);
unsigned Usr_GetNumUsrsWhoClaimToBelongToCtr (struct Ctr_Centre *Ctr);
unsigned Usr_GetCachedNumUsrsWhoClaimToBelongToCtr (struct Ctr_Centre *Ctr);
void Usr_GetListUsrs (Hie_Level_t Scope,Rol_Role_t Role);