diff --git a/swad_API.c b/swad_API.c
index 415eb97a..065054ca 100644
--- a/swad_API.c
+++ b/swad_API.c
@@ -3354,7 +3354,7 @@ int swad__getNotifications (struct soap *soap,
/* Get institution (row[4]) */
Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[4]);
- Ins_GetDataOfInstitutionByCod (&Hie.Ins);
+ Ins_GetDataOfInstitByCod (&Hie.Ins);
/* Get center (row[5]) */
Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[5]);
diff --git a/swad_browser.c b/swad_browser.c
index fcc87881..8ae4466a 100644
--- a/swad_browser.c
+++ b/swad_browser.c
@@ -5782,7 +5782,7 @@ static void Brw_WriteCurrentClipboard (void)
{
case Brw_ADMI_DOC_INS:
Hie.Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod;
- Ins_GetDataOfInstitutionByCod (&Hie.Ins);
+ Ins_GetDataOfInstitByCod (&Hie.Ins);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s %s",
Txt_documents_management_area,
@@ -5790,7 +5790,7 @@ static void Brw_WriteCurrentClipboard (void)
break;
case Brw_ADMI_SHR_INS:
Hie.Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod;
- Ins_GetDataOfInstitutionByCod (&Hie.Ins);
+ Ins_GetDataOfInstitByCod (&Hie.Ins);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s %s",
Txt_shared_files_area,
@@ -6338,7 +6338,7 @@ static void Brw_PasteClipboard (void)
case Brw_ADMI_DOC_INS:
case Brw_ADMI_SHR_INS:
Hie.Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod;
- if (Ins_GetDataOfInstitutionByCod (&Hie.Ins))
+ if (Ins_GetDataOfInstitByCod (&Hie.Ins))
snprintf (PathOrg,sizeof (PathOrg),"%s/%02u/%u/%s",
Cfg_PATH_INS_PRIVATE,
(unsigned) (Hie.Ins.InsCod % 100),
diff --git a/swad_call_for_exam.c b/swad_call_for_exam.c
index 1dfd79ab..abc6f8c2 100644
--- a/swad_call_for_exam.c
+++ b/swad_call_for_exam.c
@@ -947,7 +947,7 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams,
/***** Get data of institution of this degree *****/
Ins.InsCod = Gbl.Hierarchy.Ins.InsCod;
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
/***** Build anchor string *****/
Frm_SetAnchorStr (ExaCod,&Anchor);
@@ -1613,7 +1613,7 @@ static void Cfe_GetNotifContentCallForExam (const struct Cfe_CallsForExams *Call
/***** Get data of institution *****/
Hie.Ins.InsCod = Deg_DB_GetInsCodOfDegreeByCod (Hie.Deg.DegCod);
- Ins_GetDataOfInstitutionByCod (&Hie.Ins);
+ Ins_GetDataOfInstitByCod (&Hie.Ins);
/***** Convert struct date to a date string *****/
Dat_ConvDateToDateStr (&CallsForExams->CallForExam.ExamDate,StrExamDate);
diff --git a/swad_center_config.c b/swad_center_config.c
index a4cdf017..f70e5069 100644
--- a/swad_center_config.c
+++ b/swad_center_config.c
@@ -1023,7 +1023,7 @@ void CtrCfg_ChangeCtrIns (void)
if (NewIns.InsCod != Gbl.Hierarchy.Ctr.InsCod)
{
/***** Get data of new institution *****/
- Ins_GetDataOfInstitutionByCod (&NewIns);
+ Ins_GetDataOfInstitByCod (&NewIns);
/***** Check if it already exists a center with the same name in the new institution *****/
if (Ctr_DB_CheckIfCtrNameExistsInIns ("ShortName",
diff --git a/swad_changelog.h b/swad_changelog.h
index 08beeccd..f10024f4 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
*/
-#define Log_PLATFORM_VERSION "SWAD 21.21.1 (2021-10-01)"
+#define Log_PLATFORM_VERSION "SWAD 21.21.2 (2021-10-01)"
#define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.69.1.js"
/*
TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
+ Version 21.21.2: Oct 01, 2021 Queries moved to module swad_notification_database. (317963 lines)
Version 21.21.1: Oct 01, 2021 Queries moved to module swad_notification_database. (317938 lines)
Version 21.21: Sep 30, 2021 New module swad_notice_database for database queries related to notices. (317901 lines)
Version 21.20.1: Sep 30, 2021 Code refactoring related to nicknames. (317756 lines)
diff --git a/swad_country_config.c b/swad_country_config.c
index b44f81e1..bd5287a9 100644
--- a/swad_country_config.c
+++ b/swad_country_config.c
@@ -300,7 +300,7 @@ static void CtyCfg_Map (void)
/* Get data of institution */
Ins.InsCod = Ctr.InsCod;
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
/* Add marker */
Map_AddMarker (&Ctr.Coord);
diff --git a/swad_course.c b/swad_course.c
index d0527a5d..838780e0 100644
--- a/swad_course.c
+++ b/swad_course.c
@@ -254,7 +254,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Get data of this institution *****/
Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[0]);
- if (!Ins_GetDataOfInstitutionByCod (&Hie.Ins))
+ if (!Ins_GetDataOfInstitByCod (&Hie.Ins))
Err_WrongInstitExit ();
/***** Write link to institution *****/
diff --git a/swad_department.c b/swad_department.c
index 260f18ba..df3af967 100644
--- a/swad_department.c
+++ b/swad_department.c
@@ -465,7 +465,7 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
/* Get data of institution of this department */
Ins.InsCod = Dpt->InsCod;
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
HTM_TR_Begin (NULL);
diff --git a/swad_figure.c b/swad_figure.c
index fdc0c27a..ef53489f 100644
--- a/swad_figure.c
+++ b/swad_figure.c
@@ -1270,7 +1270,7 @@ static unsigned Fig_GetInsAndStat (struct Ins_Instit *Ins,MYSQL_RES *mysql_res)
/***** Get data of this institution (row[0]) *****/
Ins->InsCod = Str_ConvertStrCodToLongCod (row[0]);
- if (!Ins_GetDataOfInstitutionByCod (Ins))
+ if (!Ins_GetDataOfInstitByCod (Ins))
Err_WrongInstitExit ();
/***** Get statistic (row[1]) *****/
diff --git a/swad_forum.c b/swad_forum.c
index 81e18c6a..0f9603ce 100644
--- a/swad_forum.c
+++ b/swad_forum.c
@@ -1811,13 +1811,13 @@ void For_SetForumName (const struct For_Forum *Forum,
break;
case For_FORUM_INSTIT_USRS:
Hie.Ins.InsCod = Forum->Location;
- if (!Ins_GetDataOfInstitutionByCod (&Hie.Ins))
+ if (!Ins_GetDataOfInstitByCod (&Hie.Ins))
Err_WrongInstitExit ();
Str_Copy (ForumName,Hie.Ins.ShrtName,For_MAX_BYTES_FORUM_NAME);
break;
case For_FORUM_INSTIT_TCHS:
Hie.Ins.InsCod = Forum->Location;
- if (!Ins_GetDataOfInstitutionByCod (&Hie.Ins))
+ if (!Ins_GetDataOfInstitByCod (&Hie.Ins))
Err_WrongInstitExit ();
snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s",
Hie.Ins.ShrtName,
diff --git a/swad_hierarchy.c b/swad_hierarchy.c
index a1d36015..8ca6feb0 100644
--- a/swad_hierarchy.c
+++ b/swad_hierarchy.c
@@ -557,7 +557,7 @@ void Hie_InitHierarchy (void)
/***** If institution code is available, get institution data *****/
if (Gbl.Hierarchy.Ins.InsCod > 0)
{
- if (Ins_GetDataOfInstitutionByCod (&Gbl.Hierarchy.Ins)) // Institution found
+ if (Ins_GetDataOfInstitByCod (&Gbl.Hierarchy.Ins)) // Institution found
Gbl.Hierarchy.Cty.CtyCod = Gbl.Hierarchy.Ins.CtyCod;
else
Hie_ResetHierarchy ();
@@ -701,7 +701,7 @@ void Hie_GetAndWriteInsCtrDegAdminBy (long UsrCod,unsigned ColSpan)
if (Hie.Ins.InsCod > 0)
{
/* Get data of institution */
- Ins_GetDataOfInstitutionByCod (&Hie.Ins);
+ Ins_GetDataOfInstitByCod (&Hie.Ins);
/* Write institution logo and name */
Ins_DrawInstitutionLogoAndNameWithLink (&Hie.Ins,ActSeeInsInf,
diff --git a/swad_institution.c b/swad_institution.c
index 4f477e72..bc061a39 100644
--- a/swad_institution.c
+++ b/swad_institution.c
@@ -174,7 +174,7 @@ void Ins_SeeInsWithPendingCtrs (void)
Gbl.ColorRows[Gbl.RowEvenOdd];
/* Get data of institution */
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
/* Institution logo and name */
HTM_TR_Begin (NULL);
@@ -709,7 +709,7 @@ void Ins_WriteInstitutionNameAndCty (long InsCod)
/************************* Get data of an institution ************************/
/*****************************************************************************/
-bool Ins_GetDataOfInstitutionByCod (struct Ins_Instit *Ins)
+bool Ins_GetDataOfInstitByCod (struct Ins_Instit *Ins)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@@ -1220,7 +1220,7 @@ void Ins_RemoveInstitution (void)
Ins_EditingIns->InsCod = Ins_GetAndCheckParamOtherInsCod (1);
/***** Get data of the institution from database *****/
- Ins_GetDataOfInstitutionByCod (Ins_EditingIns);
+ Ins_GetDataOfInstitByCod (Ins_EditingIns);
/***** Check if this institution has users *****/
if (!Ins_CheckIfICanEdit (Ins_EditingIns))
@@ -1340,7 +1340,7 @@ void Ins_RenameInstitution (struct Ins_Instit *Ins,Cns_ShrtOrFullName_t ShrtOrFu
Par_GetParToText (ParamName,NewInsName,MaxBytes);
/***** Get from the database the old names of the institution *****/
- Ins_GetDataOfInstitutionByCod (Ins);
+ Ins_GetDataOfInstitByCod (Ins);
/***** Check if new name is empty *****/
if (NewInsName[0])
@@ -1411,7 +1411,7 @@ void Ins_ChangeInsWWW (void)
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
/***** Get data of institution *****/
- Ins_GetDataOfInstitutionByCod (Ins_EditingIns);
+ Ins_GetDataOfInstitByCod (Ins_EditingIns);
/***** Check if new WWW is empty *****/
if (NewWWW[0])
@@ -1459,7 +1459,7 @@ void Ins_ChangeInsStatus (void)
Status = Ins_GetStatusBitsFromStatusTxt (StatusTxt); // New status
/***** Get data of institution *****/
- Ins_GetDataOfInstitutionByCod (Ins_EditingIns);
+ Ins_GetDataOfInstitByCod (Ins_EditingIns);
/***** Update status in table of institutions *****/
Ins_DB_UpdateInsStatus (Status,Ins_EditingIns->InsCod);
@@ -1918,7 +1918,7 @@ void Ins_ListInssFound (MYSQL_RES **mysql_res,unsigned NumInss)
Ins.InsCod = DB_GetNextCode (*mysql_res);
/* Get data of institution */
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
/* Write data of this institution */
Ins_ListOneInstitutionForSeeing (&Ins,NumIns);
diff --git a/swad_institution.h b/swad_institution.h
index 851df24d..18332fc0 100644
--- a/swad_institution.h
+++ b/swad_institution.h
@@ -103,7 +103,7 @@ void Ins_GetBasicListOfInstitutions (long CtyCod);
void Ins_GetFullListOfInstitutions (long CtyCod);
void Ins_WriteInstitutionNameAndCty (long InsCod);
-bool Ins_GetDataOfInstitutionByCod (struct Ins_Instit *Ins);
+bool Ins_GetDataOfInstitByCod (struct Ins_Instit *Ins);
void Ins_FlushCacheFullNameAndCtyOfInstitution (void);
void Ins_FreeListInstitutions (void);
diff --git a/swad_layout.c b/swad_layout.c
index 0c210cb1..cf646f53 100644
--- a/swad_layout.c
+++ b/swad_layout.c
@@ -1537,7 +1537,7 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto,
/***** Get data of institution *****/
Hie.Ins.InsCod = InsCod;
- Ins_GetDataOfInstitutionByCod (&Hie.Ins);
+ Ins_GetDataOfInstitByCod (&Hie.Ins);
/***** Get data of degree *****/
Hie.Deg.DegCod = DegCod;
diff --git a/swad_notification.c b/swad_notification.c
index 346dcf14..db42adcc 100644
--- a/swad_notification.c
+++ b/swad_notification.c
@@ -404,7 +404,7 @@ void Ntf_ShowMyNotifications (void)
/* Get institution code (row[2]) */
Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[2]);
- Ins_GetDataOfInstitutionByCod (&Hie.Ins);
+ Ins_GetDataOfInstitByCod (&Hie.Ins);
/* Get center code (row[3]) */
Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[3]);
@@ -1394,10 +1394,7 @@ void Ntf_SendPendingNotifByEMailToAllUsrs (void)
DB_FreeMySQLResult (&mysql_res);
/***** Delete old notifications ******/
- DB_QueryDELETE ("can not remove old notifications",
- "DELETE LOW_PRIORITY FROM ntf_notifications"
- " WHERE TimeNotif0"
- " AND (Status & %u)=0"
- " AND (Status & %u)=0"
- " ORDER BY TimeNotif,"
- "NotifyEvent",
- ToUsrDat->UsrCod,
- (unsigned) Ntf_STATUS_BIT_EMAIL,
- (unsigned) Ntf_STATUS_BIT_SENT,
- (unsigned) (Ntf_STATUS_BIT_READ | Ntf_STATUS_BIT_REMOVED));
-
- if (NumNots) // Events found
+ if ((NumNtfs = Ntf_DB_GetPendingNtfsToUsr (&mysql_res,ToUsrDat->UsrCod))) // Notifications found
{
/***** If user has no language, set it to current language *****/
ToUsrLanguage = ToUsrDat->Prefs.Language;
@@ -1475,21 +1451,21 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
/***** Welcome note *****/
Mai_WriteWelcomeNoteEMail (FileMail,ToUsrDat);
- if (NumNots == 1)
+ if (NumNtfs == 1)
fprintf (FileMail,Txt_NOTIFY_EVENTS_There_is_a_new_event_NO_HTML[ToUsrLanguage],
Cfg_PLATFORM_SHORT_NAME);
else
fprintf (FileMail,Txt_NOTIFY_EVENTS_There_are_X_new_events_NO_HTML[ToUsrLanguage],
- (unsigned) NumNots,Cfg_PLATFORM_SHORT_NAME);
+ (unsigned) NumNtfs,Cfg_PLATFORM_SHORT_NAME);
fprintf (FileMail,": \n");
/***** Initialize structure with origin user's data *****/
Usr_UsrDataConstructor (&FromUsrDat);
/***** Inform about the events one by one *****/
- for (NumNot = 0;
- NumNot < NumNots;
- NumNot++)
+ for (NumNtf = 0;
+ NumNtf < NumNtfs;
+ NumNtf++)
{
/* Get next event */
row = mysql_fetch_row (mysql_res);
@@ -1503,20 +1479,19 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
Usr_DONT_GET_PREFS,
Usr_DONT_GET_ROLE_IN_CURRENT_CRS);
- /* Get institution code (row[2]) */
+ /* Get institution code (row[2]),
+ center code (row[3]),
+ degree code (row[4]),
+ course code (row[5]) */
Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[2]);
- Ins_GetDataOfInstitutionByCod (&Hie.Ins);
-
- /* Get center code (row[3]) */
Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[3]);
- Ctr_GetDataOfCenterByCod (&Hie.Ctr);
-
- /* Get degree code (row[4]) */
Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[4]);
- Deg_GetDataOfDegreeByCod (&Hie.Deg);
-
- /* Get course code (row[5]) */
Hie.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[5]);
+
+ /* Get data of institution, center, degree and course */
+ Ins_GetDataOfInstitByCod (&Hie.Ins);
+ Ctr_GetDataOfCenterByCod (&Hie.Ctr);
+ Deg_GetDataOfDegreeByCod (&Hie.Deg);
Crs_GetDataOfCourseByCod (&Hie.Crs);
/* Get message/post/... code (row[6]) */
@@ -1617,7 +1592,7 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
ReturnCode = WEXITSTATUS(ReturnCode);
if (ReturnCode == 0) // Message sent successfully
{
- *NumNotif = NumNots;
+ *NumNotif = NumNtfs;
*NumMails = 1;
/* Update statistics about notifications */
@@ -1625,18 +1600,7 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
}
/***** Mark all the pending notifications of this user as 'sent' *****/
- DB_QueryUPDATE ("can not set pending notifications of a user as sent",
- "UPDATE ntf_notifications"
- " SET Status=(Status | %u)"
- " WHERE ToUsrCod=%ld"
- " AND (Status & %u)<>0"
- " AND (Status & %u)=0"
- " AND (Status & %u)=0",
- (unsigned) Ntf_STATUS_BIT_SENT,
- ToUsrDat->UsrCod,
- (unsigned) Ntf_STATUS_BIT_EMAIL,
- (unsigned) Ntf_STATUS_BIT_SENT,
- (unsigned) (Ntf_STATUS_BIT_READ | Ntf_STATUS_BIT_REMOVED));
+ Ntf_DB_MarkPendingNtfsAsSent (ToUsrDat->UsrCod);
}
/***** Free structure that stores the query result *****/
diff --git a/swad_notification_database.c b/swad_notification_database.c
index 0ae0f5c0..049f7929 100644
--- a/swad_notification_database.c
+++ b/swad_notification_database.c
@@ -88,6 +88,26 @@ void Ntf_DB_UpdateMyLastAccessToNotifications (void)
Gbl.Usrs.Me.UsrDat.UsrCod);
}
+/*****************************************************************************/
+/********** Mark all the pending notifications of a user as 'sent' ***********/
+/*****************************************************************************/
+
+void Ntf_DB_MarkPendingNtfsAsSent (long ToUsrCod)
+ {
+ DB_QueryUPDATE ("can not set pending notifications of a user as sent",
+ "UPDATE ntf_notifications"
+ " SET Status=(Status | %u)"
+ " WHERE ToUsrCod=%ld"
+ " AND (Status & %u)<>0"
+ " AND (Status & %u)=0"
+ " AND (Status & %u)=0",
+ (unsigned) Ntf_STATUS_BIT_SENT,
+ ToUsrCod,
+ (unsigned) Ntf_STATUS_BIT_EMAIL,
+ (unsigned) Ntf_STATUS_BIT_SENT,
+ (unsigned) (Ntf_STATUS_BIT_READ | Ntf_STATUS_BIT_REMOVED));
+ }
+
/*****************************************************************************/
/********************** Set possible notification as seen ********************/
/*****************************************************************************/
@@ -303,6 +323,34 @@ unsigned Ntf_DB_GetMyNotifications (MYSQL_RES **mysql_res,bool AllNotifications)
SubQuery);
}
+/*****************************************************************************/
+/******************* Get pending notifications to a user *********************/
+/*****************************************************************************/
+
+unsigned Ntf_DB_GetPendingNtfsToUsr (MYSQL_RES **mysql_res,long ToUsrCod)
+ {
+ return (unsigned)
+ DB_QuerySELECT (mysql_res,"can not get user's pending notifications",
+ "SELECT NotifyEvent," // row[0]
+ "FromUsrCod," // row[1]
+ "InsCod," // row[2]
+ "CtrCod," // row[3]
+ "DegCod," // row[4]
+ "CrsCod," // row[5]
+ "Cod" // row[6]
+ " FROM ntf_notifications"
+ " WHERE ToUsrCod=%ld"
+ " AND (Status & %u)<>0"
+ " AND (Status & %u)=0"
+ " AND (Status & %u)=0"
+ " ORDER BY TimeNotif,"
+ "NotifyEvent",
+ ToUsrCod,
+ (unsigned) Ntf_STATUS_BIT_EMAIL,
+ (unsigned) Ntf_STATUS_BIT_SENT,
+ (unsigned) (Ntf_STATUS_BIT_READ | Ntf_STATUS_BIT_REMOVED));
+ }
+
/*****************************************************************************/
/************* Get the number of (all) my unseen notifications ***************/
/*****************************************************************************/
@@ -462,3 +510,15 @@ void Ntf_DB_RemoveUsrNtfs (long ToUsrCod)
ToUsrCod);
}
+
+/*****************************************************************************/
+/************************* Delete old notifications **************************/
+/*****************************************************************************/
+
+void Ntf_DB_RemoveOldNtfs (void)
+ {
+ DB_QueryDELETE ("can not remove old notifications",
+ "DELETE LOW_PRIORITY FROM ntf_notifications"
+ " WHERE TimeNotifInsCod;
if (Ins.InsCod > 0)
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
/***** Begin box and table *****/
sprintf (StrRecordWidth,"%upx",Rec_RECORD_WIDTH);
@@ -4114,7 +4114,7 @@ void Rec_UpdateMyInstitution (void)
/* Get country of institution */
if (Ins.InsCod > 0)
{
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
if (Gbl.Usrs.Me.UsrDat.InsCtyCod != Ins.CtyCod)
Gbl.Usrs.Me.UsrDat.InsCtyCod = Ins.CtyCod;
}
diff --git a/swad_report.c b/swad_report.c
index 4c7b6a49..ac429aeb 100644
--- a/swad_report.c
+++ b/swad_report.c
@@ -562,7 +562,7 @@ static void Rep_WriteSectionUsrInfo (void)
/***** User's institution *****/
Ins.InsCod = Gbl.Usrs.Me.UsrDat.InsCod;
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
fprintf (Gbl.F.Rep,"%s: %s",
Txt_Institution,
Ins.FullName);
diff --git a/swad_statistic.c b/swad_statistic.c
index 9bd9eb11..0b949766 100644
--- a/swad_statistic.c
+++ b/swad_statistic.c
@@ -3530,7 +3530,7 @@ static void Sta_WriteInstit (long InsCod)
{
/***** Get data of institution *****/
Ins.InsCod = InsCod;
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
/***** Title in cell *****/
HTM_TD_Begin ("class=\"LOG LM\" title=\"%s\"",Ins.FullName);
diff --git a/swad_system_config.c b/swad_system_config.c
index 323836a0..0d8950ff 100644
--- a/swad_system_config.c
+++ b/swad_system_config.c
@@ -273,7 +273,7 @@ static void SysCfg_Map (void)
/* Get data of institution */
Ins.InsCod = Ctr.InsCod;
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
/* Add marker */
Map_AddMarker (&Ctr.Coord);
diff --git a/swad_timeline_note.c b/swad_timeline_note.c
index 17f4f4c7..6141bbe8 100644
--- a/swad_timeline_note.c
+++ b/swad_timeline_note.c
@@ -446,7 +446,7 @@ static void Tml_Not_GetLocationInHierarchy (const struct Tml_Not_Note *Not,
case TL_NOTE_INS_SHA_PUB_FILE:
/* Get institution data */
Hie->Ins.InsCod = Not->HieCod;
- Ins_GetDataOfInstitutionByCod (&Hie->Ins);
+ Ins_GetDataOfInstitByCod (&Hie->Ins);
break;
case TL_NOTE_CTR_DOC_PUB_FILE:
case TL_NOTE_CTR_SHA_PUB_FILE:
diff --git a/swad_user.c b/swad_user.c
index f829b554..e1b17038 100644
--- a/swad_user.c
+++ b/swad_user.c
@@ -3743,7 +3743,7 @@ void Usr_WriteRowUsrMainData (unsigned NumUsr,struct UsrData *UsrDat,
/***** Write rest of main user's data *****/
Ins.InsCod = UsrDat->InsCod;
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
Usr_WriteMainUsrDataExceptUsrID (UsrDat,BgColor);
HTM_TD_Begin ("class=\"LM %s\"",BgColor);
@@ -3783,7 +3783,7 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat)
/***** Write rest of guest's main data *****/
Ins.InsCod = UsrDat->InsCod;
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
Usr_WriteEmail (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
@@ -3870,7 +3870,7 @@ static void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames)
/***** Write rest of main student's data *****/
Ins.InsCod = UsrDat->InsCod;
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
Usr_WriteEmail (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
@@ -3970,7 +3970,7 @@ static void Usr_WriteRowTchAllData (struct UsrData *UsrDat)
/***** Write rest of main teacher's data *****/
Ins.InsCod = UsrDat->InsCod;
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
Usr_WriteEmail (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
@@ -4043,7 +4043,7 @@ static void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat)
/***** Write rest of main administrator's data *****/
Ins.InsCod = UsrDat->InsCod;
- Ins_GetDataOfInstitutionByCod (&Ins);
+ Ins_GetDataOfInstitByCod (&Ins);
Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
HTM_TD_Begin ("class=\"LM %s\"",Gbl.ColorRows[Gbl.RowEvenOdd]);