mirror of
https://github.com/acanas/swad-core.git
synced 2024-05-29 13:03:31 +02:00
Version 20.51.21: Mar 19, 2021 Notices database tables renamed.
This commit is contained in:
parent
bc4f1949fa
commit
dcae8af717
32
sql/swad.sql
32
sql/swad.sql
|
@ -1092,9 +1092,23 @@ CREATE TABLE IF NOT EXISTS msg_snt_deleted (
|
||||||
INDEX(CrsCod),
|
INDEX(CrsCod),
|
||||||
INDEX(UsrCod));
|
INDEX(UsrCod));
|
||||||
--
|
--
|
||||||
-- Table notices: stores the yellow notes (post-it)
|
-- Table not_deleted: stores the yellow notes (post-it) that have been deleted
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS notices (
|
CREATE TABLE IF NOT EXISTS not_deleted (
|
||||||
|
NotCod INT NOT NULL,
|
||||||
|
CrsCod INT NOT NULL DEFAULT -1,
|
||||||
|
UsrCod INT NOT NULL,
|
||||||
|
CreatTime DATETIME NOT NULL,
|
||||||
|
Content TEXT NOT NULL,
|
||||||
|
NumNotif INT NOT NULL DEFAULT 0,
|
||||||
|
UNIQUE INDEX(NotCod),
|
||||||
|
INDEX(CrsCod),
|
||||||
|
INDEX(UsrCod),
|
||||||
|
INDEX(CreatTime));
|
||||||
|
--
|
||||||
|
-- Table not_notices: stores the yellow notes (post-it)
|
||||||
|
--
|
||||||
|
CREATE TABLE IF NOT EXISTS not_notices (
|
||||||
NotCod INT NOT NULL AUTO_INCREMENT,
|
NotCod INT NOT NULL AUTO_INCREMENT,
|
||||||
CrsCod INT NOT NULL DEFAULT -1,
|
CrsCod INT NOT NULL DEFAULT -1,
|
||||||
UsrCod INT NOT NULL,
|
UsrCod INT NOT NULL,
|
||||||
|
@ -1108,20 +1122,6 @@ CREATE TABLE IF NOT EXISTS notices (
|
||||||
INDEX(CreatTime),
|
INDEX(CreatTime),
|
||||||
INDEX(Status));
|
INDEX(Status));
|
||||||
--
|
--
|
||||||
-- Table notices_deleted: stores the yellow notes (post-it) that have been deleted
|
|
||||||
--
|
|
||||||
CREATE TABLE IF NOT EXISTS notices_deleted (
|
|
||||||
NotCod INT NOT NULL,
|
|
||||||
CrsCod INT NOT NULL DEFAULT -1,
|
|
||||||
UsrCod INT NOT NULL,
|
|
||||||
CreatTime DATETIME NOT NULL,
|
|
||||||
Content TEXT NOT NULL,
|
|
||||||
NumNotif INT NOT NULL DEFAULT 0,
|
|
||||||
UNIQUE INDEX(NotCod),
|
|
||||||
INDEX(CrsCod),
|
|
||||||
INDEX(UsrCod),
|
|
||||||
INDEX(CreatTime));
|
|
||||||
--
|
|
||||||
-- Table ntf_notifications: stores the notifications of events
|
-- Table ntf_notifications: stores the notifications of events
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS ntf_notifications (
|
CREATE TABLE IF NOT EXISTS ntf_notifications (
|
||||||
|
|
|
@ -3968,11 +3968,12 @@ int swad__sendNotice (struct soap *soap,
|
||||||
/* Get the code of the inserted item */
|
/* Get the code of the inserted item */
|
||||||
NotCod =
|
NotCod =
|
||||||
DB_QueryINSERTandReturnCode ("can not create message",
|
DB_QueryINSERTandReturnCode ("can not create message",
|
||||||
"INSERT INTO notices"
|
"INSERT INTO not_notices"
|
||||||
" (CrsCod,UsrCod,CreatTime,Content,Status)"
|
" (CrsCod,UsrCod,CreatTime,Content,Status)"
|
||||||
" VALUES"
|
" VALUES"
|
||||||
" (%ld,%ld,NOW(),'%s',%u)",
|
" (%ld,%ld,NOW(),'%s',%u)",
|
||||||
Gbl.Hierarchy.Crs.CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Hierarchy.Crs.CrsCod,
|
||||||
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
body,(unsigned) Not_ACTIVE_NOTICE);
|
body,(unsigned) Not_ACTIVE_NOTICE);
|
||||||
|
|
||||||
/***** Create notifications *****/
|
/***** Create notifications *****/
|
||||||
|
|
13
swad_RSS.c
13
swad_RSS.c
|
@ -159,11 +159,16 @@ static void RSS_WriteNotices (FILE *FileRSS,struct Crs_Course *Crs)
|
||||||
|
|
||||||
/***** Get active notices in course *****/
|
/***** Get active notices in course *****/
|
||||||
NumNotices = DB_QuerySELECT (&mysql_res,"can not get notices from database",
|
NumNotices = DB_QuerySELECT (&mysql_res,"can not get notices from database",
|
||||||
"SELECT NotCod,UNIX_TIMESTAMP(CreatTime) AS T,UsrCod,Content"
|
"SELECT NotCod," // row[0]
|
||||||
" FROM notices"
|
"UNIX_TIMESTAMP(CreatTime) AS T," // row[1]
|
||||||
" WHERE CrsCod=%ld AND Status=%u"
|
"UsrCod," // row[2]
|
||||||
|
"Content" // row[3]
|
||||||
|
" FROM not_notices"
|
||||||
|
" WHERE CrsCod=%ld"
|
||||||
|
" AND Status=%u"
|
||||||
" ORDER BY T DESC",
|
" ORDER BY T DESC",
|
||||||
Crs->CrsCod,(unsigned) Not_ACTIVE_NOTICE);
|
Crs->CrsCod,
|
||||||
|
(unsigned) Not_ACTIVE_NOTICE);
|
||||||
|
|
||||||
/***** Write items with notices *****/
|
/***** Write items with notices *****/
|
||||||
if (NumNotices)
|
if (NumNotices)
|
||||||
|
|
|
@ -600,13 +600,18 @@ TODO: Salvador Romero Cort
|
||||||
|
|
||||||
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
|
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 20.51.20 (2021-03-19)"
|
#define Log_PLATFORM_VERSION "SWAD 20.51.21 (2021-03-19)"
|
||||||
#define CSS_FILE "swad20.45.css"
|
#define CSS_FILE "swad20.45.css"
|
||||||
#define JS_FILE "swad20.6.2.js"
|
#define JS_FILE "swad20.6.2.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 20.51.21: Mar 19, 2021 Notices database tables renamed. (308101 lines)
|
||||||
|
2 changes necessary in database:
|
||||||
|
RENAME TABLE notices TO not_notices;
|
||||||
|
RENAME TABLE notices_deleted TO not_deleted;
|
||||||
|
|
||||||
Version 20.51.20: Mar 19, 2021 Rooms database tables renamed. (308069 lines)
|
Version 20.51.20: Mar 19, 2021 Rooms database tables renamed. (308069 lines)
|
||||||
2 changes necessary in database:
|
2 changes necessary in database:
|
||||||
RENAME TABLE room_MAC TO roo_MACs;
|
RENAME TABLE room_MAC TO roo_MACs;
|
||||||
|
|
|
@ -1988,16 +1988,22 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
|
||||||
/***** Remove notices in the course *****/
|
/***** Remove notices in the course *****/
|
||||||
/* Copy all notices from the course to table of deleted notices */
|
/* Copy all notices from the course to table of deleted notices */
|
||||||
DB_QueryINSERT ("can not remove notices in a course",
|
DB_QueryINSERT ("can not remove notices in a course",
|
||||||
"INSERT INTO notices_deleted"
|
"INSERT INTO not_deleted"
|
||||||
" (NotCod,CrsCod,UsrCod,CreatTime,Content,NumNotif)"
|
" (NotCod,CrsCod,UsrCod,CreatTime,Content,NumNotif)"
|
||||||
" SELECT NotCod,CrsCod,UsrCod,CreatTime,Content,NumNotif"
|
" SELECT NotCod,"
|
||||||
" FROM notices"
|
"CrsCod,"
|
||||||
|
"UsrCod,"
|
||||||
|
"CreatTime,"
|
||||||
|
"Content,"
|
||||||
|
"NumNotif"
|
||||||
|
" FROM not_notices"
|
||||||
" WHERE CrsCod=%ld",
|
" WHERE CrsCod=%ld",
|
||||||
CrsCod);
|
CrsCod);
|
||||||
|
|
||||||
/* Remove all notices from the course */
|
/* Remove all notices from the course */
|
||||||
DB_QueryDELETE ("can not remove notices in a course",
|
DB_QueryDELETE ("can not remove notices in a course",
|
||||||
"DELETE FROM notices WHERE CrsCod=%ld",
|
"DELETE FROM not_notices"
|
||||||
|
" WHERE CrsCod=%ld",
|
||||||
CrsCod);
|
CrsCod);
|
||||||
|
|
||||||
/***** Remove all the threads and posts in forums of the course *****/
|
/***** Remove all the threads and posts in forums of the course *****/
|
||||||
|
|
|
@ -2281,9 +2281,36 @@ mysql> DESCRIBE msg_snt_deleted;
|
||||||
"INDEX(CrsCod),"
|
"INDEX(CrsCod),"
|
||||||
"INDEX(UsrCod))");
|
"INDEX(UsrCod))");
|
||||||
|
|
||||||
/***** Table notices *****/
|
/***** Table not_deleted *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE notices;
|
mysql> DESCRIBE not_deleted;
|
||||||
|
+-----------+----------+------+-----+---------+-------+
|
||||||
|
| Field | Type | Null | Key | Default | Extra |
|
||||||
|
+-----------+----------+------+-----+---------+-------+
|
||||||
|
| NotCod | int(11) | NO | PRI | NULL | |
|
||||||
|
| CrsCod | int(11) | NO | MUL | -1 | |
|
||||||
|
| UsrCod | int(11) | NO | MUL | NULL | |
|
||||||
|
| CreatTime | datetime | NO | MUL | NULL | |
|
||||||
|
| Content | text | NO | | NULL | |
|
||||||
|
| NumNotif | int(11) | NO | | 0 | |
|
||||||
|
+-----------+----------+------+-----+---------+-------+
|
||||||
|
6 rows in set (0.01 sec)
|
||||||
|
*/
|
||||||
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS not_deleted ("
|
||||||
|
"NotCod INT NOT NULL,"
|
||||||
|
"CrsCod INT NOT NULL DEFAULT -1,"
|
||||||
|
"UsrCod INT NOT NULL,"
|
||||||
|
"CreatTime DATETIME NOT NULL,"
|
||||||
|
"Content TEXT NOT NULL,"
|
||||||
|
"NumNotif INT NOT NULL DEFAULT 0,"
|
||||||
|
"UNIQUE INDEX(NotCod),"
|
||||||
|
"INDEX(CrsCod),"
|
||||||
|
"INDEX(UsrCod),"
|
||||||
|
"INDEX(CreatTime))");
|
||||||
|
|
||||||
|
/***** Table not_notices *****/
|
||||||
|
/*
|
||||||
|
mysql> DESCRIBE not_notices;
|
||||||
+-----------+------------+------+-----+---------+----------------+
|
+-----------+------------+------+-----+---------+----------------+
|
||||||
| Field | Type | Null | Key | Default | Extra |
|
| Field | Type | Null | Key | Default | Extra |
|
||||||
+-----------+------------+------+-----+---------+----------------+
|
+-----------+------------+------+-----+---------+----------------+
|
||||||
|
@ -2297,7 +2324,7 @@ mysql> DESCRIBE notices;
|
||||||
+-----------+------------+------+-----+---------+----------------+
|
+-----------+------------+------+-----+---------+----------------+
|
||||||
7 rows in set (0.00 sec)
|
7 rows in set (0.00 sec)
|
||||||
*/
|
*/
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS notices ("
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS not_notices ("
|
||||||
"NotCod INT NOT NULL AUTO_INCREMENT,"
|
"NotCod INT NOT NULL AUTO_INCREMENT,"
|
||||||
"CrsCod INT NOT NULL DEFAULT -1,"
|
"CrsCod INT NOT NULL DEFAULT -1,"
|
||||||
"UsrCod INT NOT NULL,"
|
"UsrCod INT NOT NULL,"
|
||||||
|
@ -2311,33 +2338,6 @@ mysql> DESCRIBE notices;
|
||||||
"INDEX(CreatTime),"
|
"INDEX(CreatTime),"
|
||||||
"INDEX(Status))");
|
"INDEX(Status))");
|
||||||
|
|
||||||
/***** Table notices_deleted *****/
|
|
||||||
/*
|
|
||||||
mysql> DESCRIBE notices_deleted;
|
|
||||||
+-----------+----------+------+-----+---------+-------+
|
|
||||||
| Field | Type | Null | Key | Default | Extra |
|
|
||||||
+-----------+----------+------+-----+---------+-------+
|
|
||||||
| NotCod | int(11) | NO | PRI | NULL | |
|
|
||||||
| CrsCod | int(11) | NO | MUL | -1 | |
|
|
||||||
| UsrCod | int(11) | NO | MUL | NULL | |
|
|
||||||
| CreatTime | datetime | NO | MUL | NULL | |
|
|
||||||
| Content | text | NO | | NULL | |
|
|
||||||
| NumNotif | int(11) | NO | | 0 | |
|
|
||||||
+-----------+----------+------+-----+---------+-------+
|
|
||||||
6 rows in set (0.01 sec)
|
|
||||||
*/
|
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS notices_deleted ("
|
|
||||||
"NotCod INT NOT NULL,"
|
|
||||||
"CrsCod INT NOT NULL DEFAULT -1,"
|
|
||||||
"UsrCod INT NOT NULL,"
|
|
||||||
"CreatTime DATETIME NOT NULL,"
|
|
||||||
"Content TEXT NOT NULL,"
|
|
||||||
"NumNotif INT NOT NULL DEFAULT 0,"
|
|
||||||
"UNIQUE INDEX(NotCod),"
|
|
||||||
"INDEX(CrsCod),"
|
|
||||||
"INDEX(UsrCod),"
|
|
||||||
"INDEX(CreatTime))");
|
|
||||||
|
|
||||||
/***** Table ntf_notifications *****/
|
/***** Table ntf_notifications *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE ntf_notifications;
|
mysql> DESCRIBE ntf_notifications;
|
||||||
|
|
210
swad_notice.c
210
swad_notice.c
|
@ -172,7 +172,7 @@ static long Not_InsertNoticeInDB (const char *Content)
|
||||||
/***** Insert notice in the database *****/
|
/***** Insert notice in the database *****/
|
||||||
return
|
return
|
||||||
DB_QueryINSERTandReturnCode ("can not create notice",
|
DB_QueryINSERTandReturnCode ("can not create notice",
|
||||||
"INSERT INTO notices"
|
"INSERT INTO not_notices"
|
||||||
" (CrsCod,UsrCod,CreatTime,Content,Status)"
|
" (CrsCod,UsrCod,CreatTime,Content,Status)"
|
||||||
" VALUES"
|
" VALUES"
|
||||||
" (%ld,%ld,NOW(),'%s',%u)",
|
" (%ld,%ld,NOW(),'%s',%u)",
|
||||||
|
@ -189,7 +189,9 @@ static void Not_UpdateNumUsrsNotifiedByEMailAboutNotice (long NotCod,unsigned Nu
|
||||||
{
|
{
|
||||||
/***** Update number of users notified *****/
|
/***** Update number of users notified *****/
|
||||||
DB_QueryUPDATE ("can not update the number of notifications of a notice",
|
DB_QueryUPDATE ("can not update the number of notifications of a notice",
|
||||||
"UPDATE notices SET NumNotif=%u WHERE NotCod=%ld",
|
"UPDATE not_notices"
|
||||||
|
" SET NumNotif=%u"
|
||||||
|
" WHERE NotCod=%ld",
|
||||||
NumUsrsToBeNotifiedByEMail,NotCod);
|
NumUsrsToBeNotifiedByEMail,NotCod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,8 +244,10 @@ void Not_HideActiveNotice (void)
|
||||||
|
|
||||||
/***** Set notice as hidden *****/
|
/***** Set notice as hidden *****/
|
||||||
DB_QueryUPDATE ("can not hide notice",
|
DB_QueryUPDATE ("can not hide notice",
|
||||||
"UPDATE notices SET Status=%u"
|
"UPDATE not_notices"
|
||||||
" WHERE NotCod=%ld AND CrsCod=%ld",
|
" SET Status=%u"
|
||||||
|
" WHERE NotCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
(unsigned) Not_OBSOLETE_NOTICE,
|
(unsigned) Not_OBSOLETE_NOTICE,
|
||||||
NotCod,Gbl.Hierarchy.Crs.CrsCod);
|
NotCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
|
||||||
|
@ -267,8 +271,10 @@ void Not_RevealHiddenNotice (void)
|
||||||
|
|
||||||
/***** Set notice as active *****/
|
/***** Set notice as active *****/
|
||||||
DB_QueryUPDATE ("can not reveal notice",
|
DB_QueryUPDATE ("can not reveal notice",
|
||||||
"UPDATE notices SET Status=%u"
|
"UPDATE not_notices"
|
||||||
" WHERE NotCod=%ld AND CrsCod=%ld",
|
" SET Status=%u"
|
||||||
|
" WHERE NotCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
(unsigned) Not_ACTIVE_NOTICE,
|
(unsigned) Not_ACTIVE_NOTICE,
|
||||||
NotCod,Gbl.Hierarchy.Crs.CrsCod);
|
NotCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
|
||||||
|
@ -323,17 +329,24 @@ void Not_RemoveNotice (void)
|
||||||
/***** Remove notice *****/
|
/***** Remove notice *****/
|
||||||
/* Copy notice to table of deleted notices */
|
/* Copy notice to table of deleted notices */
|
||||||
DB_QueryINSERT ("can not remove notice",
|
DB_QueryINSERT ("can not remove notice",
|
||||||
"INSERT IGNORE INTO notices_deleted"
|
"INSERT IGNORE INTO not_deleted"
|
||||||
" (NotCod,CrsCod,UsrCod,CreatTime,Content,NumNotif)"
|
" (NotCod,CrsCod,UsrCod,CreatTime,Content,NumNotif)"
|
||||||
" SELECT NotCod,CrsCod,UsrCod,CreatTime,Content,NumNotif"
|
" SELECT NotCod,"
|
||||||
" FROM notices"
|
"CrsCod,"
|
||||||
" WHERE NotCod=%ld AND CrsCod=%ld",
|
"UsrCod,"
|
||||||
|
"CreatTime,"
|
||||||
|
"Content,"
|
||||||
|
"NumNotif"
|
||||||
|
" FROM not_notices"
|
||||||
|
" WHERE NotCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
NotCod,Gbl.Hierarchy.Crs.CrsCod);
|
NotCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
|
||||||
/* Remove notice */
|
/* Remove notice */
|
||||||
DB_QueryDELETE ("can not remove notice",
|
DB_QueryDELETE ("can not remove notice",
|
||||||
"DELETE FROM notices"
|
"DELETE FROM not_notices"
|
||||||
" WHERE NotCod=%ld AND CrsCod=%ld",
|
" WHERE NotCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
NotCod,Gbl.Hierarchy.Crs.CrsCod);
|
NotCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
|
||||||
/***** Mark possible notifications as removed *****/
|
/***** Mark possible notifications as removed *****/
|
||||||
|
@ -383,8 +396,9 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing,long HighlightNotCod)
|
||||||
"UsrCod,"
|
"UsrCod,"
|
||||||
"Content,"
|
"Content,"
|
||||||
"Status"
|
"Status"
|
||||||
" FROM notices"
|
" FROM not_notices"
|
||||||
" WHERE CrsCod=%ld AND Status=%u"
|
" WHERE CrsCod=%ld"
|
||||||
|
" AND Status=%u"
|
||||||
" ORDER BY CreatTime DESC",
|
" ORDER BY CreatTime DESC",
|
||||||
Gbl.Hierarchy.Crs.CrsCod,
|
Gbl.Hierarchy.Crs.CrsCod,
|
||||||
(unsigned) Not_ACTIVE_NOTICE);
|
(unsigned) Not_ACTIVE_NOTICE);
|
||||||
|
@ -396,7 +410,7 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing,long HighlightNotCod)
|
||||||
"UsrCod,"
|
"UsrCod,"
|
||||||
"Content,"
|
"Content,"
|
||||||
"Status"
|
"Status"
|
||||||
" FROM notices"
|
" FROM not_notices"
|
||||||
" WHERE CrsCod=%ld"
|
" WHERE CrsCod=%ld"
|
||||||
" ORDER BY CreatTime DESC",
|
" ORDER BY CreatTime DESC",
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
@ -565,11 +579,11 @@ static void Not_GetDataAndShowNotice (long NotCod)
|
||||||
|
|
||||||
/***** Get notice data from database *****/
|
/***** Get notice data from database *****/
|
||||||
if (DB_QuerySELECT (&mysql_res,"can not get notice from database",
|
if (DB_QuerySELECT (&mysql_res,"can not get notice from database",
|
||||||
"SELECT UNIX_TIMESTAMP(CreatTime) AS F,"
|
"SELECT UNIX_TIMESTAMP(CreatTime) AS F," // row[0]
|
||||||
"UsrCod,"
|
"UsrCod," // row[1]
|
||||||
"Content,"
|
"Content," // row[2]
|
||||||
"Status"
|
"Status" // row[3]
|
||||||
" FROM notices"
|
" FROM not_notices"
|
||||||
" WHERE NotCod=%ld AND CrsCod=%ld",
|
" WHERE NotCod=%ld AND CrsCod=%ld",
|
||||||
NotCod,Gbl.Hierarchy.Crs.CrsCod))
|
NotCod,Gbl.Hierarchy.Crs.CrsCod))
|
||||||
{
|
{
|
||||||
|
@ -772,7 +786,9 @@ void Not_GetSummaryAndContentNotice (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
||||||
|
|
||||||
/***** Get subject of message from database *****/
|
/***** Get subject of message from database *****/
|
||||||
if (DB_QuerySELECT (&mysql_res,"can not get content of notice",
|
if (DB_QuerySELECT (&mysql_res,"can not get content of notice",
|
||||||
"SELECT Content FROM notices WHERE NotCod=%ld",
|
"SELECT Content" // row[0]
|
||||||
|
" FROM not_notices"
|
||||||
|
" WHERE NotCod=%ld",
|
||||||
NotCod) == 1) // Result should have a unique row
|
NotCod) == 1) // Result should have a unique row
|
||||||
{
|
{
|
||||||
/***** Get sumary / content *****/
|
/***** Get sumary / content *****/
|
||||||
|
@ -822,79 +838,79 @@ unsigned Not_GetNumNotices (Hie_Lvl_Level_t Scope,Not_Status_t Status,unsigned *
|
||||||
{
|
{
|
||||||
case Hie_Lvl_SYS:
|
case Hie_Lvl_SYS:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of notices",
|
DB_QuerySELECT (&mysql_res,"can not get number of notices",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(NumNotif)"
|
"SUM(NumNotif)" // row[1]
|
||||||
" FROM notices"
|
" FROM not_notices"
|
||||||
" WHERE Status=%u",
|
" WHERE Status=%u",
|
||||||
Status);
|
Status);
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_CTY:
|
case Hie_Lvl_CTY:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of notices",
|
DB_QuerySELECT (&mysql_res,"can not get number of notices",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(notices.NumNotif)"
|
"SUM(not_notices.NumNotif)" // row[1]
|
||||||
" FROM ins_instits,"
|
" FROM ins_instits,"
|
||||||
"ctr_centers,"
|
"ctr_centers,"
|
||||||
"deg_degrees,"
|
"deg_degrees,"
|
||||||
"crs_courses,"
|
"crs_courses,"
|
||||||
"notices"
|
"not_notices"
|
||||||
" WHERE ins_instits.CtyCod=%ld"
|
" WHERE ins_instits.CtyCod=%ld"
|
||||||
" AND ins_instits.InsCod=ctr_centers.InsCod"
|
" AND ins_instits.InsCod=ctr_centers.InsCod"
|
||||||
" 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=notices.CrsCod"
|
" AND crs_courses.CrsCod=not_notices.CrsCod"
|
||||||
" AND notices.Status=%u",
|
" AND not_notices.Status=%u",
|
||||||
Gbl.Hierarchy.Cty.CtyCod,
|
Gbl.Hierarchy.Cty.CtyCod,
|
||||||
Status);
|
Status);
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_INS:
|
case Hie_Lvl_INS:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of notices",
|
DB_QuerySELECT (&mysql_res,"can not get number of notices",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(notices.NumNotif)"
|
"SUM(not_notices.NumNotif)" // row[1]
|
||||||
" FROM ctr_centers,"
|
" FROM ctr_centers,"
|
||||||
"deg_degrees,"
|
"deg_degrees,"
|
||||||
"crs_courses,"
|
"crs_courses,"
|
||||||
"notices"
|
"not_notices"
|
||||||
" WHERE ctr_centers.InsCod=%ld"
|
" WHERE ctr_centers.InsCod=%ld"
|
||||||
" 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=notices.CrsCod"
|
" AND crs_courses.CrsCod=not_notices.CrsCod"
|
||||||
" AND notices.Status=%u",
|
" AND not_notices.Status=%u",
|
||||||
Gbl.Hierarchy.Ins.InsCod,
|
Gbl.Hierarchy.Ins.InsCod,
|
||||||
Status);
|
Status);
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_CTR:
|
case Hie_Lvl_CTR:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of notices",
|
DB_QuerySELECT (&mysql_res,"can not get number of notices",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(notices.NumNotif)"
|
"SUM(not_notices.NumNotif)" // row[1]
|
||||||
" FROM deg_degrees,"
|
" FROM deg_degrees,"
|
||||||
"crs_courses,"
|
"crs_courses,"
|
||||||
"notices"
|
"not_notices"
|
||||||
" 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=notices.CrsCod"
|
" AND crs_courses.CrsCod=not_notices.CrsCod"
|
||||||
" AND notices.Status=%u",
|
" AND not_notices.Status=%u",
|
||||||
Gbl.Hierarchy.Ctr.CtrCod,
|
Gbl.Hierarchy.Ctr.CtrCod,
|
||||||
Status);
|
Status);
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_DEG:
|
case Hie_Lvl_DEG:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of notices",
|
DB_QuerySELECT (&mysql_res,"can not get number of notices",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(notices.NumNotif)"
|
"SUM(not_notices.NumNotif)" // row[1]
|
||||||
" FROM crs_courses,"
|
" FROM crs_courses,"
|
||||||
"notices"
|
"not_notices"
|
||||||
" WHERE crs_courses.DegCod=%ld"
|
" WHERE crs_courses.DegCod=%ld"
|
||||||
" AND crs_courses.CrsCod=notices.CrsCod"
|
" AND crs_courses.CrsCod=not_notices.CrsCod"
|
||||||
" AND notices.Status=%u",
|
" AND not_notices.Status=%u",
|
||||||
Gbl.Hierarchy.Deg.DegCod,
|
Gbl.Hierarchy.Deg.DegCod,
|
||||||
Status);
|
Status);
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_CRS:
|
case Hie_Lvl_CRS:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of notices",
|
DB_QuerySELECT (&mysql_res,"can not get number of notices",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(NumNotif)"
|
"SUM(NumNotif)" // row[1]
|
||||||
" FROM notices"
|
" FROM not_notices"
|
||||||
" WHERE CrsCod=%ld"
|
" WHERE CrsCod=%ld"
|
||||||
" AND Status=%u",
|
" AND Status=%u",
|
||||||
Gbl.Hierarchy.Crs.CrsCod,
|
Gbl.Hierarchy.Crs.CrsCod,
|
||||||
Status);
|
Status);
|
||||||
break;
|
break;
|
||||||
|
@ -940,67 +956,67 @@ unsigned Not_GetNumNoticesDeleted (Hie_Lvl_Level_t Scope,unsigned *NumNotif)
|
||||||
{
|
{
|
||||||
case Hie_Lvl_SYS:
|
case Hie_Lvl_SYS:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of deleted notices",
|
DB_QuerySELECT (&mysql_res,"can not get number of deleted notices",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(NumNotif)"
|
"SUM(NumNotif)" // row[1]
|
||||||
" FROM notices_deleted");
|
" FROM not_deleted");
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_CTY:
|
case Hie_Lvl_CTY:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of deleted notices",
|
DB_QuerySELECT (&mysql_res,"can not get number of deleted notices",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(notices_deleted.NumNotif)"
|
"SUM(not_deleted.NumNotif)" // row[1]
|
||||||
" FROM ins_instits,"
|
" FROM ins_instits,"
|
||||||
"ctr_centers,"
|
"ctr_centers,"
|
||||||
"deg_degrees,"
|
"deg_degrees,"
|
||||||
"crs_courses,"
|
"crs_courses,"
|
||||||
"notices_deleted"
|
"not_deleted"
|
||||||
" WHERE ins_instits.CtyCod=%ld"
|
" WHERE ins_instits.CtyCod=%ld"
|
||||||
" AND ins_instits.InsCod=ctr_centers.InsCod"
|
" AND ins_instits.InsCod=ctr_centers.InsCod"
|
||||||
" 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=notices_deleted.CrsCod",
|
" AND crs_courses.CrsCod=not_deleted.CrsCod",
|
||||||
Gbl.Hierarchy.Cty.CtyCod);
|
Gbl.Hierarchy.Cty.CtyCod);
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_INS:
|
case Hie_Lvl_INS:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of deleted notices",
|
DB_QuerySELECT (&mysql_res,"can not get number of deleted notices",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(notices_deleted.NumNotif)"
|
"SUM(not_deleted.NumNotif)" // row[1]
|
||||||
" FROM ctr_centers,"
|
" FROM ctr_centers,"
|
||||||
"deg_degrees,"
|
"deg_degrees,"
|
||||||
"crs_courses,"
|
"crs_courses,"
|
||||||
"notices_deleted"
|
"not_deleted"
|
||||||
" WHERE ctr_centers.InsCod=%ld"
|
" WHERE ctr_centers.InsCod=%ld"
|
||||||
" 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=notices_deleted.CrsCod",
|
" AND crs_courses.CrsCod=not_deleted.CrsCod",
|
||||||
Gbl.Hierarchy.Ins.InsCod);
|
Gbl.Hierarchy.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_CTR:
|
case Hie_Lvl_CTR:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of deleted notices",
|
DB_QuerySELECT (&mysql_res,"can not get number of deleted notices",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(notices_deleted.NumNotif)"
|
"SUM(not_deleted.NumNotif)" // row[1]
|
||||||
" FROM deg_degrees,"
|
" FROM deg_degrees,"
|
||||||
"crs_courses,"
|
"crs_courses,"
|
||||||
"notices_deleted"
|
"not_deleted"
|
||||||
" 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=notices_deleted.CrsCod",
|
" AND crs_courses.CrsCod=not_deleted.CrsCod",
|
||||||
Gbl.Hierarchy.Ctr.CtrCod);
|
Gbl.Hierarchy.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_DEG:
|
case Hie_Lvl_DEG:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of deleted notices",
|
DB_QuerySELECT (&mysql_res,"can not get number of deleted notices",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(notices_deleted.NumNotif)"
|
"SUM(not_deleted.NumNotif)" // row[1]
|
||||||
" FROM crs_courses,"
|
" FROM crs_courses,"
|
||||||
"notices_deleted"
|
"not_deleted"
|
||||||
" WHERE crs_courses.DegCod=%ld"
|
" WHERE crs_courses.DegCod=%ld"
|
||||||
" AND crs_courses.CrsCod=notices_deleted.CrsCod",
|
" AND crs_courses.CrsCod=not_deleted.CrsCod",
|
||||||
Gbl.Hierarchy.Deg.DegCod);
|
Gbl.Hierarchy.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Hie_Lvl_CRS:
|
case Hie_Lvl_CRS:
|
||||||
DB_QuerySELECT (&mysql_res,"can not get number of deleted notices",
|
DB_QuerySELECT (&mysql_res,"can not get number of deleted notices",
|
||||||
"SELECT COUNT(*),"
|
"SELECT COUNT(*)," // row[0]
|
||||||
"SUM(NumNotif)"
|
"SUM(NumNotif)" // row[1]
|
||||||
" FROM notices_deleted"
|
" FROM not_deleted"
|
||||||
" WHERE CrsCod=%ld",
|
" WHERE CrsCod=%ld",
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user