2021-02-11 00:58:53 +01:00
|
|
|
|
// swad_timeline_note.h: social timeline notes
|
|
|
|
|
|
2021-03-04 17:47:08 +01:00
|
|
|
|
#ifndef _SWAD_TML_NOT
|
|
|
|
|
#define _SWAD_TML_NOT
|
2021-02-11 00:58:53 +01:00
|
|
|
|
/*
|
|
|
|
|
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.
|
2024-02-07 00:40:28 +01:00
|
|
|
|
Copyright (C) 1999-2024 Antonio Ca<EFBFBD>as Vargas
|
2021-02-11 00:58:53 +01:00
|
|
|
|
|
|
|
|
|
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 types *******************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-11-12 01:12:15 +01:00
|
|
|
|
#define Tml_NOT_NUM_NOTE_TYPES 13
|
2021-02-11 00:58:53 +01:00
|
|
|
|
// If the numbers assigned to each event type change,
|
2021-03-04 18:37:16 +01:00
|
|
|
|
// it is necessary to change old numbers to new ones in database table tml_notes
|
2021-02-11 00:58:53 +01:00
|
|
|
|
typedef enum
|
|
|
|
|
{
|
2022-05-30 19:03:56 +02:00
|
|
|
|
TmlNot_UNKNOWN = 0,
|
2021-02-11 00:58:53 +01:00
|
|
|
|
/* Start tab */
|
2022-05-30 19:03:56 +02:00
|
|
|
|
TmlNot_POST = 10, // Post written directly in timeline
|
2021-02-11 00:58:53 +01:00
|
|
|
|
/* Institution tab */
|
2022-05-30 19:03:56 +02:00
|
|
|
|
TmlNot_INS_DOC_PUB_FILE = 1, // Public file in documents of institution
|
|
|
|
|
TmlNot_INS_SHA_PUB_FILE = 2, // Public file in shared files of institution
|
2021-03-07 21:21:04 +01:00
|
|
|
|
/* Center tab */
|
2022-05-30 19:03:56 +02:00
|
|
|
|
TmlNot_CTR_DOC_PUB_FILE = 3, // Public file in documents of center
|
|
|
|
|
TmlNot_CTR_SHA_PUB_FILE = 4, // Public file in shared files of center
|
2021-02-11 00:58:53 +01:00
|
|
|
|
/* Degree tab */
|
2022-05-30 19:03:56 +02:00
|
|
|
|
TmlNot_DEG_DOC_PUB_FILE = 5, // Public file in documents of degree
|
|
|
|
|
TmlNot_DEG_SHA_PUB_FILE = 6, // Public file in shared files of degree
|
2021-02-11 00:58:53 +01:00
|
|
|
|
/* Course tab */
|
2022-05-30 19:03:56 +02:00
|
|
|
|
TmlNot_CRS_DOC_PUB_FILE = 7, // Public file in documents of course
|
|
|
|
|
TmlNot_CRS_SHA_PUB_FILE = 8, // Public file in shared files of course
|
2021-02-11 00:58:53 +01:00
|
|
|
|
/* Assessment tab */
|
2022-05-30 19:03:56 +02:00
|
|
|
|
TmlNot_CALL_FOR_EXAM = 9, // Call for exam in a course
|
2021-02-11 00:58:53 +01:00
|
|
|
|
/* Users tab */
|
|
|
|
|
/* Messages tab */
|
2022-05-30 19:03:56 +02:00
|
|
|
|
TmlNot_NOTICE = 12, // A public notice in a course
|
|
|
|
|
TmlNot_FORUM_POST = 11, // Post in global/swad forums
|
2021-02-11 00:58:53 +01:00
|
|
|
|
/* Analytics tab */
|
|
|
|
|
/* Profile tab */
|
2021-12-31 14:51:44 +01:00
|
|
|
|
} TmlNot_Type_t;
|
2021-02-11 00:58:53 +01:00
|
|
|
|
|
2021-12-31 14:51:44 +01:00
|
|
|
|
struct TmlNot_Note
|
2021-02-11 00:58:53 +01:00
|
|
|
|
{
|
2021-11-10 00:39:09 +01:00
|
|
|
|
long NotCod; // Unique code/identifier for each note
|
2021-12-31 14:51:44 +01:00
|
|
|
|
TmlNot_Type_t Type; // Timeline post, public file,
|
2021-11-10 00:39:09 +01:00
|
|
|
|
// call for exam, notice, forum post...
|
|
|
|
|
long UsrCod; // Publisher
|
|
|
|
|
long HieCod; // Hierarchy code
|
|
|
|
|
// (institution/center/degree/course)
|
|
|
|
|
long Cod; // Code of file, forum post,
|
|
|
|
|
// notice, timeline post...
|
2022-05-30 19:03:56 +02:00
|
|
|
|
bool Unavailable; // File, forum post, notice...
|
2021-11-10 00:39:09 +01:00
|
|
|
|
// 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
|
2021-02-11 00:58:53 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/****************************** Public prototypes ****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlNot_ShowHighlightedNote (struct Tml_Timeline *Timeline,
|
2022-05-30 19:03:56 +02:00
|
|
|
|
struct TmlNot_Note *Not);
|
2021-02-11 00:58:53 +01:00
|
|
|
|
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlNot_CheckAndWriteNoteWithTopMsg (const struct Tml_Timeline *Timeline,
|
2022-05-30 19:03:56 +02:00
|
|
|
|
const struct TmlNot_Note *Not,
|
|
|
|
|
Tml_TopMessage_t TopMessage,
|
|
|
|
|
long PublisherCod);
|
2022-10-15 10:58:23 +02:00
|
|
|
|
void TmlNot_ShowAuthorPhoto (struct Usr_Data *UsrDat);
|
2022-09-24 18:30:26 +02:00
|
|
|
|
void TmlNot_WriteAuthorName (const struct Usr_Data *UsrDat,
|
2022-05-30 19:03:56 +02:00
|
|
|
|
const char *Class);
|
2021-02-11 00:58:53 +01:00
|
|
|
|
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlNot_GetNoteSummary (const struct TmlNot_Note *Not,
|
2022-05-30 19:03:56 +02:00
|
|
|
|
char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1]);
|
2021-02-11 00:58:53 +01:00
|
|
|
|
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlNot_StoreAndPublishNote (TmlNot_Type_t NoteType,long Cod);
|
|
|
|
|
void TmlNot_StoreAndPublishNoteInternal (TmlNot_Type_t NoteType,long Cod,
|
2022-05-30 19:03:56 +02:00
|
|
|
|
struct TmlPub_Publication *Pub);
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlNot_MarkNoteOneFileAsUnavailable (const char *Path);
|
|
|
|
|
void TmlNot_MarkNotesChildrenOfFolderAsUnavailable (const char *Path);
|
2021-02-11 00:58:53 +01:00
|
|
|
|
|
2023-03-17 12:51:11 +01:00
|
|
|
|
void TmlNot_ReqRemNoteUsr (void);
|
|
|
|
|
void TmlNot_ReqRemNoteGbl (void);
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlNot_RemoveNoteUsr (void);
|
|
|
|
|
void TmlNot_RemoveNoteGbl (void);
|
2021-02-11 00:58:53 +01:00
|
|
|
|
|
2023-03-23 09:35:20 +01:00
|
|
|
|
void TmlNot_GetNoteDataByCod (struct TmlNot_Note *Not);
|
2021-02-11 00:58:53 +01:00
|
|
|
|
|
|
|
|
|
#endif
|