Version 14.80.9

This commit is contained in:
Antonio Cañas Vargas 2015-03-09 01:32:31 +01:00
parent be89a03b3d
commit 26ea342f12
2 changed files with 51 additions and 1 deletions

View File

@ -103,11 +103,12 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 14.80.8 (2015/03/09)"
#define Log_PLATFORM_VERSION "SWAD 14.80.9 (2015/03/09)"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h | tail -1
/*
Version 14.80.9: Mar 09, 2015 Scope country for statistic of messages. (179187 lines)
Version 14.80.8: Mar 09, 2015 Scope country for statistic of forums. (179138 lines)
Version 14.80.7: Mar 09, 2015 Scope country for statistic of surveys. (179021 lines)
Version 14.80.6: Mar 09, 2015 Scope country for statistic of columns. (178987 lines)

View File

@ -1821,6 +1821,18 @@ unsigned Msg_GetNumMsgsSent (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
sprintf (Query,"SELECT COUNT(*) FROM %s",
Table);
break;
case Sco_SCOPE_CTY:
sprintf (Query,"SELECT COUNT(*)"
" FROM institutions,centres,degrees,courses,%s"
" WHERE institutions.CtyCod='%ld'"
" AND institutions.InsCod=centres.InsCod"
" AND centres.CtrCod=degrees.CtrCod"
" AND degrees.DegCod=courses.DegCod"
" AND courses.CrsCod=%s.CrsCod",
Table,
Gbl.CurrentCty.Cty.CtyCod,
Table);
break;
case Sco_SCOPE_INS:
sprintf (Query,"SELECT COUNT(*)"
" FROM centres,degrees,courses,%s"
@ -1889,6 +1901,19 @@ unsigned Msg_GetNumMsgsReceived (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
sprintf (Query,"SELECT COUNT(*) FROM %s",
Table);
break;
case Sco_SCOPE_CTY:
sprintf (Query,"SELECT COUNT(*)"
" FROM institutions,centres,degrees,courses,%s,msg_snt"
" WHERE institutions.CtyCod='%ld'"
" AND institutions.InsCod=centres.InsCod"
" AND centres.CtrCod=degrees.CtrCod"
" AND degrees.DegCod=courses.DegCod"
" AND courses.CrsCod=msg_snt.CrsCod"
" AND msg_snt.MsgCod=%s.MsgCod",
Table,
Gbl.CurrentCty.Cty.CtyCod,
Table);
break;
case Sco_SCOPE_INS:
sprintf (Query,"SELECT COUNT(*)"
" FROM centres,degrees,courses,%s,msg_snt"
@ -1949,6 +1974,30 @@ unsigned Msg_GetNumMsgsReceived (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
" FROM msg_rcv_deleted"
" WHERE Notified='Y')");
break;
case Sco_SCOPE_CTY:
sprintf (Query,"SELECT "
"(SELECT COUNT(*)"
" FROM institutions,centres,degrees,courses,msg_snt,msg_rcv"
" WHERE institutions.CtyCod='%ld'"
" AND institutions.InsCod=centres.InsCod"
" AND centres.CtrCod=degrees.CtrCod"
" AND degrees.DegCod=courses.DegCod"
" AND courses.CrsCod=msg_snt.CrsCod"
" AND msg_snt.MsgCod=msg_rcv.MsgCod"
" AND msg_rcv.Notified='Y')"
" + "
"(SELECT COUNT(*)"
" FROM institutions,centres,degrees,courses,msg_snt,msg_rcv_deleted"
" WHERE institutions.CtyCod='%ld'"
" AND institutions.InsCod=centres.InsCod"
" AND centres.CtrCod=degrees.CtrCod"
" AND degrees.DegCod=courses.DegCod"
" AND courses.CrsCod=msg_snt.CrsCod"
" AND msg_snt.MsgCod=msg_rcv_deleted.MsgCod"
" AND msg_rcv_deleted.Notified='Y')",
Gbl.CurrentCty.Cty.CtyCod,
Gbl.CurrentCty.Cty.CtyCod);
break;
case Sco_SCOPE_INS:
sprintf (Query,"SELECT "
"(SELECT COUNT(*)"