Version 20.50.8: Mar 17, 2021 Clicks-without-photo database table renamed.

This commit is contained in:
acanas 2021-03-17 13:37:45 +01:00
parent 3cee1db7c1
commit b935933e94
4 changed files with 36 additions and 29 deletions

View File

@ -144,13 +144,6 @@ CREATE TABLE IF NOT EXISTS cht_rooms (
NumUsrs INT NOT NULL,
UNIQUE INDEX(RoomCode));
--
-- Table clicks_without_photo: stores the number of clicks that remains to each user before being required to submit his/her photo
--
CREATE TABLE IF NOT EXISTS clicks_without_photo (
UsrCod INT NOT NULL,
NumClicks INT NOT NULL,
UNIQUE INDEX(UsrCod));
--
-- Table clipboard: clipboard (paths used to copy-paste folders and files)
--
CREATE TABLE IF NOT EXISTS clipboard (
@ -1185,6 +1178,13 @@ CREATE TABLE IF NOT EXISTS pending_passwd (
DateAndTime DATETIME NOT NULL,
PRIMARY KEY(UsrCod));
--
-- Table pho_clicks_without_photo: stores the number of clicks that remains to each user before being required to submit his/her photo
--
CREATE TABLE IF NOT EXISTS pho_clicks_without_photo (
UsrCod INT NOT NULL,
NumClicks INT NOT NULL,
UNIQUE INDEX(UsrCod));
--
-- Table places: stores the places associated to each institution, used in holidays
--
CREATE TABLE IF NOT EXISTS places (

View File

@ -600,12 +600,16 @@ 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.
*/
#define Log_PLATFORM_VERSION "SWAD 20.50.7 (2021-03-17)"
#define Log_PLATFORM_VERSION "SWAD 20.50.8 (2021-03-17)"
#define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.6.2.js"
/*
TODO: Rename CENTRE to CENTER in help wiki.
Version 20.50.8: Mar 17, 2021 Clicks-without-photo database table renamed. (307324 lines)
1 change necessary in database:
RENAME TABLE clicks_without_photo TO pho_clicks_without_photo;
Version 20.50.7: Mar 17, 2021 Chat database table renamed. (307318 lines)
1 change necessary in database:
RENAME TABLE chat TO cht_rooms;

View File

@ -397,22 +397,6 @@ mysql> DESCRIBE cht_rooms;
"NumUsrs INT NOT NULL,"
"UNIQUE INDEX(RoomCode))");
/***** Table clicks_without_photo *****/
/*
mysql> DESCRIBE clicks_without_photo;
+-----------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+-------+
| UsrCod | int(11) | NO | PRI | NULL | |
| NumClicks | int(11) | NO | | NULL | |
+-----------+---------+------+-----+---------+-------+
2 rows in set (0.00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS clicks_without_photo ("
"UsrCod INT NOT NULL,"
"NumClicks INT NOT NULL,"
"UNIQUE INDEX(UsrCod))");
/***** Table clipboard *****/
/*
mysql> DESCRIBE clipboard;
@ -2472,6 +2456,22 @@ mysql> DESCRIBE pending_passwd;
"DateAndTime DATETIME NOT NULL,"
"PRIMARY KEY (UsrCod))");
/***** Table pho_clicks_without_photo *****/
/*
mysql> DESCRIBE pho_clicks_without_photo;
+-----------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+-------+
| UsrCod | int(11) | NO | PRI | NULL | |
| NumClicks | int(11) | NO | | NULL | |
+-----------+---------+------+-----+---------+-------+
2 rows in set (0.00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS pho_clicks_without_photo ("
"UsrCod INT NOT NULL,"
"NumClicks INT NOT NULL,"
"UNIQUE INDEX(UsrCod))");
/***** Table places *****/
/*
mysql> DESCRIBE places;

View File

@ -932,7 +932,8 @@ unsigned Pho_UpdateMyClicksWithoutPhoto (void)
/***** Get number of clicks without photo from database *****/
NumRows = DB_QuerySELECT (&mysql_res,"can not get number of clicks"
" without photo",
"SELECT NumClicks FROM clicks_without_photo"
"SELECT NumClicks"
" FROM pho_clicks_without_photo"
" WHERE UsrCod=%ld",
Gbl.Usrs.Me.UsrDat.UsrCod);
@ -947,8 +948,9 @@ unsigned Pho_UpdateMyClicksWithoutPhoto (void)
if (NumClicks <= Pho_MAX_CLICKS_WITHOUT_PHOTO)
{
DB_QueryUPDATE ("can not update number of clicks without photo",
"UPDATE clicks_without_photo"
" SET NumClicks=NumClicks+1 WHERE UsrCod=%ld",
"UPDATE pho_clicks_without_photo"
" SET NumClicks=NumClicks+1"
" WHERE UsrCod=%ld",
Gbl.Usrs.Me.UsrDat.UsrCod);
NumClicks++;
}
@ -957,7 +959,7 @@ unsigned Pho_UpdateMyClicksWithoutPhoto (void)
{
/* Add the user, with one access */
DB_QueryINSERT ("can not create number of clicks without photo",
"INSERT INTO clicks_without_photo"
"INSERT INTO pho_clicks_without_photo"
" (UsrCod,NumClicks)"
" VALUES"
" (%ld,1)",
@ -979,7 +981,8 @@ unsigned Pho_UpdateMyClicksWithoutPhoto (void)
void Pho_RemoveUsrFromTableClicksWithoutPhoto (long UsrCod)
{
DB_QueryDELETE ("can not remove a user from the list of users without photo",
"DELETE FROM clicks_without_photo WHERE UsrCod=%ld",
"DELETE FROM pho_clicks_without_photo"
" WHERE UsrCod=%ld",
UsrCod);
}