Version 21.56.4: Nov 10, 2021 Code refactoring in switch statements (until swad_network_database.c).

This commit is contained in:
acanas 2021-11-10 21:42:44 +01:00
parent fdb90c34d1
commit f9b4ab100b
7 changed files with 107 additions and 146 deletions

View File

@ -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. TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
*/ */
#define Log_PLATFORM_VERSION "SWAD 21.56.3 (2021-11-10)" #define Log_PLATFORM_VERSION "SWAD 21.56.4 (2021-11-10)"
#define CSS_FILE "swad20.45.css" #define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.69.1.js" #define JS_FILE "swad20.69.1.js"
/* /*
TODO: Rename CENTRE to CENTER in help wiki. TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
Version 21.56.4: Nov 10, 2021 Code refactoring in switch statements (until swad_network_database.c). (319362 lines)
Version 21.56.3: Nov 10, 2021 Code refactoring in switch statements (until swad_logo.c). (319403 lines) Version 21.56.3: Nov 10, 2021 Code refactoring in switch statements (until swad_logo.c). (319403 lines)
Version 21.56.2: Nov 10, 2021 Code refactoring in pointers to text. (319501 lines) Version 21.56.2: Nov 10, 2021 Code refactoring in pointers to text. (319501 lines)
Version 21.56.1: Nov 10, 2021 Code refactoring in switch statements (until swad_enrolment.c). (319490 lines) Version 21.56.1: Nov 10, 2021 Code refactoring in switch statements (until swad_enrolment.c). (319490 lines)

View File

@ -1063,7 +1063,23 @@ static void Mai_ShowFormChangeUsrEmail (bool ItsMe,
unsigned NumEmails; unsigned NumEmails;
unsigned NumEmail; unsigned NumEmail;
bool Confirmed; bool Confirmed;
Act_Action_t NextAction; static const struct
{
Act_Action_t Remove;
Act_Action_t New;
} NextAction[Rol_NUM_ROLES] =
{
[Rol_UNK ] = {ActRemMaiOth,ActNewMaiOth},
[Rol_GST ] = {ActRemMaiOth,ActNewMaiOth},
[Rol_USR ] = {ActRemMaiOth,ActNewMaiOth},
[Rol_STD ] = {ActRemMaiStd,ActNewMaiStd},
[Rol_NET ] = {ActRemMaiTch,ActNewMaiTch},
[Rol_TCH ] = {ActRemMaiTch,ActNewMaiTch},
[Rol_DEG_ADM] = {ActRemMaiOth,ActNewMaiOth},
[Rol_CTR_ADM] = {ActRemMaiOth,ActNewMaiOth},
[Rol_INS_ADM] = {ActRemMaiOth,ActNewMaiOth},
[Rol_SYS_ADM] = {ActRemMaiOth,ActNewMaiOth},
};
const struct UsrData *UsrDat = (ItsMe ? &Gbl.Usrs.Me.UsrDat : const struct UsrData *UsrDat = (ItsMe ? &Gbl.Usrs.Me.UsrDat :
&Gbl.Usrs.Other.UsrDat); &Gbl.Usrs.Other.UsrDat);
@ -1118,23 +1134,8 @@ static void Mai_ShowFormChangeUsrEmail (bool ItsMe,
Ico_PutContextualIconToRemove (ActRemMyMai,Mai_EMAIL_SECTION_ID, Ico_PutContextualIconToRemove (ActRemMyMai,Mai_EMAIL_SECTION_ID,
Mai_PutParamsRemoveMyEmail,row[0]); Mai_PutParamsRemoveMyEmail,row[0]);
else else
{ Ico_PutContextualIconToRemove (NextAction[UsrDat->Roles.InCurrentCrs].Remove,Mai_EMAIL_SECTION_ID,
switch (UsrDat->Roles.InCurrentCrs)
{
case Rol_STD:
NextAction = ActRemMaiStd;
break;
case Rol_NET:
case Rol_TCH:
NextAction = ActRemMaiTch;
break;
default: // Guest, user or admin
NextAction = ActRemMaiOth;
break;
}
Ico_PutContextualIconToRemove (NextAction,Mai_EMAIL_SECTION_ID,
Mai_PutParamsRemoveOtherEmail,row[0]); Mai_PutParamsRemoveOtherEmail,row[0]);
}
/* Email */ /* Email */
HTM_Txt (row[0]); HTM_Txt (row[0]);
@ -1156,20 +1157,7 @@ static void Mai_ShowFormChangeUsrEmail (bool ItsMe,
Frm_BeginFormAnchor (ActChgMyMai,Mai_EMAIL_SECTION_ID); Frm_BeginFormAnchor (ActChgMyMai,Mai_EMAIL_SECTION_ID);
else else
{ {
switch (UsrDat->Roles.InCurrentCrs) Frm_BeginFormAnchor (NextAction[UsrDat->Roles.InCurrentCrs].New,Mai_EMAIL_SECTION_ID);
{
case Rol_STD:
NextAction = ActNewMaiStd;
break;
case Rol_NET:
case Rol_TCH:
NextAction = ActNewMaiTch;
break;
default: // Guest, user or admin
NextAction = ActNewMaiOth;
break;
}
Frm_BeginFormAnchor (NextAction,Mai_EMAIL_SECTION_ID);
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
} }
Par_PutHiddenParamString (NULL,"NewEmail",row[0]); Par_PutHiddenParamString (NULL,"NewEmail",row[0]);
@ -1202,20 +1190,7 @@ static void Mai_ShowFormChangeUsrEmail (bool ItsMe,
Frm_BeginFormAnchor (ActChgMyMai,Mai_EMAIL_SECTION_ID); Frm_BeginFormAnchor (ActChgMyMai,Mai_EMAIL_SECTION_ID);
else else
{ {
switch (UsrDat->Roles.InCurrentCrs) Frm_BeginFormAnchor (NextAction[UsrDat->Roles.InCurrentCrs].New,Mai_EMAIL_SECTION_ID);
{
case Rol_STD:
NextAction = ActNewMaiStd;
break;
case Rol_NET:
case Rol_TCH:
NextAction = ActNewMaiTch;
break;
default: // Guest, user or admin
NextAction = ActNewMaiOth;
break;
}
Frm_BeginFormAnchor (NextAction,Mai_EMAIL_SECTION_ID);
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
} }
HTM_INPUT_EMAIL ("NewEmail",Cns_MAX_CHARS_EMAIL_ADDRESS,Gbl.Usrs.Me.UsrDat.Email, HTM_INPUT_EMAIL ("NewEmail",Cns_MAX_CHARS_EMAIL_ADDRESS,Gbl.Usrs.Me.UsrDat.Email,

View File

@ -512,15 +512,14 @@ static void Mch_ListOneOrMoreMatchesHeading (bool ICanEditMatches)
static bool Mch_CheckIfICanEditMatches (void) static bool Mch_CheckIfICanEditMatches (void)
{ {
switch (Gbl.Usrs.Me.Role.Logged) static const bool ICanEditMatches[Rol_NUM_ROLES] =
{ {
case Rol_NET: [Rol_NET ] = true,
case Rol_TCH: [Rol_TCH ] = true,
case Rol_SYS_ADM: [Rol_SYS_ADM] = true,
return true; };
default:
return false; return ICanEditMatches[Gbl.Usrs.Me.Role.Logged];
}
} }
/*****************************************************************************/ /*****************************************************************************/
@ -766,22 +765,21 @@ static void Mch_ListOneOrMoreMatchesStatus (struct Mch_Match *Match,unsigned Num
static void Mch_ListOneOrMoreMatchesResult (struct Gam_Games *Games, static void Mch_ListOneOrMoreMatchesResult (struct Gam_Games *Games,
const struct Mch_Match *Match) const struct Mch_Match *Match)
{ {
static void (*Function[Rol_NUM_ROLES]) (struct Gam_Games *Games,
const struct Mch_Match *Match) =
{
[Rol_STD ] = Mch_ListOneOrMoreMatchesResultStd,
[Rol_NET ] = Mch_ListOneOrMoreMatchesResultTch,
[Rol_TCH ] = Mch_ListOneOrMoreMatchesResultTch,
[Rol_SYS_ADM] = Mch_ListOneOrMoreMatchesResultTch,
};
HTM_TD_Begin ("class=\"DAT CT COLOR%u\"",Gbl.RowEvenOdd); HTM_TD_Begin ("class=\"DAT CT COLOR%u\"",Gbl.RowEvenOdd);
switch (Gbl.Usrs.Me.Role.Logged) if (Function[Gbl.Usrs.Me.Role.Logged])
{ Function[Gbl.Usrs.Me.Role.Logged] (Games,Match);
case Rol_STD: else
Mch_ListOneOrMoreMatchesResultStd (Games,Match);
break;
case Rol_NET:
case Rol_TCH:
case Rol_SYS_ADM:
Mch_ListOneOrMoreMatchesResultTch (Games,Match);
break;
default:
Err_WrongRoleExit (); Err_WrongRoleExit ();
break;
}
HTM_TD_End (); HTM_TD_End ();
} }

View File

@ -703,6 +703,15 @@ static void Usr_GetTitleFromForm (const char *ParamName,struct Med_Media *Media)
static void Med_GetAndProcessFileFromForm (const char *ParamFile, static void Med_GetAndProcessFileFromForm (const char *ParamFile,
struct Med_Media *Media) struct Med_Media *Media)
{ {
static void (*Process[Med_NUM_TYPES]) (struct Med_Media *Media,
const char PathFileOrg[PATH_MAX + 1]) =
{
[Med_JPG ] = Med_ProcessJPG,
[Med_GIF ] = Med_ProcessGIF,
[Med_MP4 ] = Med_ProcessVideo,
[Med_WEBM] = Med_ProcessVideo,
[Med_OGG ] = Med_ProcessVideo,
};
struct Param *Param; struct Param *Param;
char FileNameImgSrc[PATH_MAX + 1]; char FileNameImgSrc[PATH_MAX + 1];
char *PtrExtension; char *PtrExtension;
@ -760,22 +769,8 @@ static void Med_GetAndProcessFileFromForm (const char *ParamFile,
Media->Type = Med_JPG; Media->Type = Med_JPG;
/***** Process media depending on the media file extension *****/ /***** Process media depending on the media file extension *****/
switch (Media->Type) if (Process[Media->Type])
{ Process[Media->Type] (Media,PathFileOrg);
case Med_JPG:
Med_ProcessJPG (Media,PathFileOrg);
break;
case Med_GIF:
Med_ProcessGIF (Media,PathFileOrg);
break;
case Med_MP4:
case Med_WEBM:
case Med_OGG:
Med_ProcessVideo (Media,PathFileOrg);
break;
default:
break;
}
} }
/***** Remove temporary original file *****/ /***** Remove temporary original file *****/
@ -1393,6 +1388,16 @@ void Med_StoreMediaInDB (struct Med_Media *Media)
void Med_ShowMedia (const struct Med_Media *Media, void Med_ShowMedia (const struct Med_Media *Media,
const char *ClassContainer,const char *ClassMedia) const char *ClassContainer,const char *ClassMedia)
{ {
static void (*Show[Med_NUM_TYPES]) (const struct Med_Media *Media,
const char PathMedPriv[PATH_MAX + 1],
const char *ClassMedia) =
{
[Med_JPG ] = Med_ShowJPG,
[Med_GIF ] = Med_ShowGIF,
[Med_MP4 ] = Med_ShowVideo,
[Med_WEBM] = Med_ShowVideo,
[Med_OGG ] = Med_ShowVideo,
};
bool PutLink; bool PutLink;
char PathMedPriv[PATH_MAX + 1]; char PathMedPriv[PATH_MAX + 1];
@ -1435,22 +1440,8 @@ void Med_ShowMedia (const struct Med_Media *Media,
Media->Name[1]); Media->Name[1]);
/* Show media */ /* Show media */
switch (Media->Type) if (Show[Media->Type])
{ Show[Media->Type] (Media,PathMedPriv,ClassMedia);
case Med_JPG:
Med_ShowJPG (Media,PathMedPriv,ClassMedia);
break;
case Med_GIF:
Med_ShowGIF (Media,PathMedPriv,ClassMedia);
break;
case Med_MP4:
case Med_WEBM:
case Med_OGG:
Med_ShowVideo (Media,PathMedPriv,ClassMedia);
break;
default:
break;
}
/* End optional link to external URL */ /* End optional link to external URL */
if (PutLink) if (PutLink)

View File

@ -1788,11 +1788,17 @@ static void Msg_ShowFormSelectCourseSentOrRecMsgs (const struct Msg_Messages *Me
extern const char *Txt_Messages_received_from_A_COURSE; extern const char *Txt_Messages_received_from_A_COURSE;
extern const char *Txt_Messages_sent_from_A_COURSE; extern const char *Txt_Messages_sent_from_A_COURSE;
extern const char *Txt_any_course; extern const char *Txt_any_course;
static unsigned (*GetDistinctCrssInMyRcvMsgs[Msg_NUM_TYPES_OF_MSGS]) (MYSQL_RES **mysql_res) =
{
[Msg_WRITING ] = NULL,
[Msg_RECEIVED] = Msg_DB_GetDistinctCrssInMyRcvMsgs,
[Msg_SENT ] = Msg_DB_GetDistinctCrssInMySntMsgs,
};
static const char **TxtSelector[Msg_NUM_TYPES_OF_MSGS] = static const char **TxtSelector[Msg_NUM_TYPES_OF_MSGS] =
{ {
[Msg_WRITING ] = NULL, [Msg_WRITING ] = NULL,
[Msg_RECEIVED] = &Txt_Messages_received_from_A_COURSE, [Msg_RECEIVED] = &Txt_Messages_received_from_A_COURSE,
[Msg_SENT ] = &Txt_Messages_sent_from_A_COURSE [Msg_SENT ] = &Txt_Messages_sent_from_A_COURSE,
}; };
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -1801,17 +1807,8 @@ static void Msg_ShowFormSelectCourseSentOrRecMsgs (const struct Msg_Messages *Me
long CrsCod; long CrsCod;
/***** Get distinct courses in my messages *****/ /***** Get distinct courses in my messages *****/
switch (Messages->TypeOfMessages) if (GetDistinctCrssInMyRcvMsgs[Messages->TypeOfMessages])
{ NumCrss = GetDistinctCrssInMyRcvMsgs[Messages->TypeOfMessages] (&mysql_res);
case Msg_RECEIVED:
NumCrss = Msg_DB_GetDistinctCrssInMyRcvMsgs (&mysql_res);
break;
case Msg_SENT:
NumCrss = Msg_DB_GetDistinctCrssInMySntMsgs (&mysql_res);
break;
default: // Not aplicable here
break;
}
/***** Course selection *****/ /***** Course selection *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);

View File

@ -52,6 +52,7 @@ typedef enum
Msg_SENT, Msg_SENT,
} Msg_TypeOfMessages_t; } Msg_TypeOfMessages_t;
#define Msg_NUM_STATUS 3
typedef enum typedef enum
{ {
Msg_STATUS_ALL, Msg_STATUS_ALL,

View File

@ -980,24 +980,19 @@ unsigned Msg_DB_GetKnownRecipients (MYSQL_RES **mysql_res,long MsgCod)
unsigned Msg_DB_GetNumSntMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus) unsigned Msg_DB_GetNumSntMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
{ {
const char *Table = "msg_snt"; static const char *Table[Msg_NUM_STATUS] =
{
[Msg_STATUS_ALL ] = "msg_snt",
[Msg_STATUS_DELETED ] = "msg_snt_deleted",
[Msg_STATUS_NOTIFIED] = "msg_snt",
};
/***** Get the number of messages sent from this location /***** Get the number of messages sent from this location
(all the platform, current degree or current course) from database *****/ (all the platform, current degree or current course) from database *****/
switch (MsgStatus)
{
case Msg_STATUS_ALL:
case Msg_STATUS_NOTIFIED:
Table = "msg_snt";
break;
case Msg_STATUS_DELETED:
Table = "msg_snt_deleted";
break;
}
switch (Scope) switch (Scope)
{ {
case HieLvl_SYS: case HieLvl_SYS:
return (unsigned) DB_GetNumRowsTable (Table); return (unsigned) DB_GetNumRowsTable (Table[MsgStatus]);
case HieLvl_CTY: case HieLvl_CTY:
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of sent messages", DB_QueryCOUNT ("can not get number of sent messages",
@ -1012,9 +1007,9 @@ unsigned Msg_DB_GetNumSntMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
" AND ctr_centers.CtrCod=deg_degrees.CtrCod" " AND ctr_centers.CtrCod=deg_degrees.CtrCod"
" AND deg_degrees.DegCod=crs_courses.DegCod" " AND deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=%s.CrsCod", " AND crs_courses.CrsCod=%s.CrsCod",
Table, Table[MsgStatus],
Gbl.Hierarchy.Cty.CtyCod, Gbl.Hierarchy.Cty.CtyCod,
Table); Table[MsgStatus]);
case HieLvl_INS: case HieLvl_INS:
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of sent messages", DB_QueryCOUNT ("can not get number of sent messages",
@ -1027,9 +1022,9 @@ unsigned Msg_DB_GetNumSntMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
" AND ctr_centers.CtrCod=deg_degrees.CtrCod" " AND ctr_centers.CtrCod=deg_degrees.CtrCod"
" AND deg_degrees.DegCod=crs_courses.DegCod" " AND deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=%s.CrsCod", " AND crs_courses.CrsCod=%s.CrsCod",
Table, Table[MsgStatus],
Gbl.Hierarchy.Ins.InsCod, Gbl.Hierarchy.Ins.InsCod,
Table); Table[MsgStatus]);
case HieLvl_CTR: case HieLvl_CTR:
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of sent messages", DB_QueryCOUNT ("can not get number of sent messages",
@ -1040,9 +1035,9 @@ unsigned Msg_DB_GetNumSntMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
" WHERE deg_degrees.CtrCod=%ld" " WHERE deg_degrees.CtrCod=%ld"
" AND deg_degrees.DegCod=crs_courses.DegCod" " AND deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=%s.CrsCod", " AND crs_courses.CrsCod=%s.CrsCod",
Table, Table[MsgStatus],
Gbl.Hierarchy.Ctr.CtrCod, Gbl.Hierarchy.Ctr.CtrCod,
Table); Table[MsgStatus]);
case HieLvl_DEG: case HieLvl_DEG:
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of sent messages", DB_QueryCOUNT ("can not get number of sent messages",
@ -1051,16 +1046,16 @@ unsigned Msg_DB_GetNumSntMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
"%s" "%s"
" WHERE crs_courses.DegCod=%ld" " WHERE crs_courses.DegCod=%ld"
" AND crs_courses.CrsCod=%s.CrsCod", " AND crs_courses.CrsCod=%s.CrsCod",
Table, Table[MsgStatus],
Gbl.Hierarchy.Deg.DegCod, Gbl.Hierarchy.Deg.DegCod,
Table); Table[MsgStatus]);
case HieLvl_CRS: case HieLvl_CRS:
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of sent messages", DB_QueryCOUNT ("can not get number of sent messages",
"SELECT COUNT(*)" "SELECT COUNT(*)"
" FROM %s" " FROM %s"
" WHERE CrsCod=%ld", " WHERE CrsCod=%ld",
Table, Table[MsgStatus],
Gbl.Hierarchy.Crs.CrsCod); Gbl.Hierarchy.Crs.CrsCod);
default: default:
return 0; return 0;
@ -1074,7 +1069,12 @@ unsigned Msg_DB_GetNumSntMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
unsigned Msg_DB_GetNumRcvMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus) unsigned Msg_DB_GetNumRcvMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
{ {
char *Table; static const char *Table[Msg_NUM_STATUS] =
{
[Msg_STATUS_ALL ] = "msg_rcv",
[Msg_STATUS_DELETED ] = "msg_rcv_deleted",
[Msg_STATUS_NOTIFIED] = "msg_rcv", // Not used
};
/***** Get the number of unique messages sent from this location /***** Get the number of unique messages sent from this location
(all the platform, current degree or current course) from database *****/ (all the platform, current degree or current course) from database *****/
@ -1082,12 +1082,10 @@ unsigned Msg_DB_GetNumRcvMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
{ {
case Msg_STATUS_ALL: case Msg_STATUS_ALL:
case Msg_STATUS_DELETED: case Msg_STATUS_DELETED:
Table = (MsgStatus == Msg_STATUS_ALL) ? "msg_rcv" :
"msg_rcv_deleted";
switch (Scope) switch (Scope)
{ {
case HieLvl_SYS: case HieLvl_SYS:
return (unsigned) DB_GetNumRowsTable (Table); return (unsigned) DB_GetNumRowsTable (Table[MsgStatus]);
case HieLvl_CTY: case HieLvl_CTY:
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of received messages", DB_QueryCOUNT ("can not get number of received messages",
@ -1104,9 +1102,9 @@ unsigned Msg_DB_GetNumRcvMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
" AND deg_degrees.DegCod=crs_courses.DegCod" " AND deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=msg_snt.CrsCod" " AND crs_courses.CrsCod=msg_snt.CrsCod"
" AND msg_snt.MsgCod=%s.MsgCod", " AND msg_snt.MsgCod=%s.MsgCod",
Table, Table[MsgStatus],
Gbl.Hierarchy.Cty.CtyCod, Gbl.Hierarchy.Cty.CtyCod,
Table); Table[MsgStatus]);
case HieLvl_INS: case HieLvl_INS:
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of received messages", DB_QueryCOUNT ("can not get number of received messages",
@ -1121,9 +1119,9 @@ unsigned Msg_DB_GetNumRcvMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
" AND deg_degrees.DegCod=crs_courses.DegCod" " AND deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=msg_snt.CrsCod" " AND crs_courses.CrsCod=msg_snt.CrsCod"
" AND msg_snt.MsgCod=%s.MsgCod", " AND msg_snt.MsgCod=%s.MsgCod",
Table, Table[MsgStatus],
Gbl.Hierarchy.Ins.InsCod, Gbl.Hierarchy.Ins.InsCod,
Table); Table[MsgStatus]);
case HieLvl_CTR: case HieLvl_CTR:
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of received messages", DB_QueryCOUNT ("can not get number of received messages",
@ -1136,9 +1134,9 @@ unsigned Msg_DB_GetNumRcvMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
" AND deg_degrees.DegCod=crs_courses.DegCod" " AND deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=msg_snt.CrsCod" " AND crs_courses.CrsCod=msg_snt.CrsCod"
" AND msg_snt.MsgCod=%s.MsgCod", " AND msg_snt.MsgCod=%s.MsgCod",
Table, Table[MsgStatus],
Gbl.Hierarchy.Ctr.CtrCod, Gbl.Hierarchy.Ctr.CtrCod,
Table); Table[MsgStatus]);
case HieLvl_DEG: case HieLvl_DEG:
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of received messages", DB_QueryCOUNT ("can not get number of received messages",
@ -1149,9 +1147,9 @@ unsigned Msg_DB_GetNumRcvMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
" WHERE crs_courses.DegCod=%ld" " WHERE crs_courses.DegCod=%ld"
" AND crs_courses.CrsCod=msg_snt.CrsCod" " AND crs_courses.CrsCod=msg_snt.CrsCod"
" AND msg_snt.MsgCod=%s.MsgCod", " AND msg_snt.MsgCod=%s.MsgCod",
Table, Table[MsgStatus],
Gbl.Hierarchy.Deg.DegCod, Gbl.Hierarchy.Deg.DegCod,
Table); Table[MsgStatus]);
case HieLvl_CRS: case HieLvl_CRS:
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of received messages", DB_QueryCOUNT ("can not get number of received messages",
@ -1160,9 +1158,9 @@ unsigned Msg_DB_GetNumRcvMsgs (HieLvl_Level_t Scope,Msg_Status_t MsgStatus)
"%s" "%s"
" WHERE msg_snt.CrsCod=%ld" " WHERE msg_snt.CrsCod=%ld"
" AND msg_snt.MsgCod=%s.MsgCod", " AND msg_snt.MsgCod=%s.MsgCod",
Table, Table[MsgStatus],
Gbl.Hierarchy.Crs.CrsCod, Gbl.Hierarchy.Crs.CrsCod,
Table); Table[MsgStatus]);
case HieLvl_UNK: case HieLvl_UNK:
default: default:
return 0; return 0;