mirror of
https://github.com/acanas/swad-core.git
synced 2024-09-07 00:00:33 +02:00
Version 20.45: Mar 06, 2021 Centers database table renamed.
This commit is contained in:
parent
c86e71dc3b
commit
11be8771c1
2
Makefile
2
Makefile
|
@ -29,7 +29,7 @@
|
|||
OBJS = swad_account.o swad_action.o swad_agenda.o swad_alert.o \
|
||||
swad_announcement.o swad_API.o swad_assignment.o swad_attendance.o \
|
||||
swad_banner.o swad_box.o swad_building.o swad_button.o \
|
||||
swad_calendar.o swad_centre.o swad_centre_config.o swad_chat.o \
|
||||
swad_calendar.o swad_center.o swad_center_config.o swad_chat.o \
|
||||
swad_config.o swad_connected.o swad_cookie.o swad_country.o \
|
||||
swad_country_config.o swad_course.o \
|
||||
swad_course_config.o swad_cryptography.o \
|
||||
|
|
|
@ -359,14 +359,14 @@ a:hover /* Default ==> underlined */
|
|||
}
|
||||
}
|
||||
|
||||
/****** Breadcrumb (platform/country/institution/centre/degree/course) *******/
|
||||
/****** Breadcrumb (platform/country/institution/center/degree/course) *******/
|
||||
#head_row_2_hierarchy
|
||||
{
|
||||
display:table-cell;
|
||||
text-align:center;
|
||||
vertical-align:middle;
|
||||
}
|
||||
.TOP_LOGO /* Institution / Centre / Degree logo in top title */
|
||||
.TOP_LOGO /* Institution / Center / Degree logo in top title */
|
||||
{
|
||||
height:40px;
|
||||
margin-right:10px;
|
||||
|
@ -461,7 +461,7 @@ a:hover /* Default ==> underlined */
|
|||
margin:-1px 0 1px 0;
|
||||
}
|
||||
|
||||
/******** Big name of country, institution, centre, degree or course *********/
|
||||
/******** Big name of country, institution, center, degree or course *********/
|
||||
#main_title
|
||||
{
|
||||
margin:0;
|
||||
|
@ -643,11 +643,10 @@ a:hover /* Default ==> underlined */
|
|||
{
|
||||
font-size:9pt;
|
||||
font-weight:bold;
|
||||
line-height:100%;
|
||||
max-width:30px;
|
||||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
margin:0 auto;
|
||||
padding-top:2px;
|
||||
text-transform:uppercase;
|
||||
}
|
||||
}
|
||||
|
@ -692,11 +691,10 @@ a:hover /* Default ==> underlined */
|
|||
{
|
||||
font-size:9pt;
|
||||
font-weight:bold;
|
||||
line-height:100%;
|
||||
max-width:50px;
|
||||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
margin:0 auto;
|
||||
padding-top:2px;
|
||||
text-transform:uppercase;
|
||||
}
|
||||
}
|
||||
|
@ -741,11 +739,10 @@ a:hover /* Default ==> underlined */
|
|||
{
|
||||
font-size:9pt;
|
||||
font-weight:bold;
|
||||
line-height:100%;
|
||||
max-width:100px;
|
||||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
margin:0 auto;
|
||||
padding-top:2px;
|
||||
text-transform:uppercase;
|
||||
}
|
||||
}
|
||||
|
@ -1328,7 +1325,7 @@ a:hover /* Default ==> underlined */
|
|||
height:260px;
|
||||
margin:10px;
|
||||
}
|
||||
.CENTRE_PHOTO_WIDTH {width:260px;}
|
||||
.CENTER_PHOTO_WIDTH {width:260px;}
|
||||
#AttributionArea
|
||||
{
|
||||
box-sizing:border-box;
|
||||
|
@ -1345,7 +1342,7 @@ a:hover /* Default ==> underlined */
|
|||
height:360px;
|
||||
margin:10px;
|
||||
}
|
||||
.COUNTRY_MAP_WIDTH, .CENTRE_PHOTO_WIDTH {width:460px;}
|
||||
.COUNTRY_MAP_WIDTH, .CENTER_PHOTO_WIDTH {width:460px;}
|
||||
#AttributionArea
|
||||
{
|
||||
box-sizing:border-box;
|
||||
|
@ -1366,19 +1363,19 @@ a:hover /* Default ==> underlined */
|
|||
height:460px;
|
||||
margin:9px auto;
|
||||
}
|
||||
.CENTRE_PHOTO_SHOW
|
||||
.CENTER_PHOTO_SHOW
|
||||
{
|
||||
box-sizing:border-box;
|
||||
padding:2px;
|
||||
margin:9px auto;
|
||||
border:solid 1px #EEE;
|
||||
}
|
||||
a:hover img.CENTRE_PHOTO_SHOW
|
||||
a:hover img.CENTER_PHOTO_SHOW
|
||||
{
|
||||
border:solid 1px #CCC;
|
||||
box-shadow:1px 1px 6px #999;
|
||||
}
|
||||
.CENTRE_PHOTO_PRINT
|
||||
.CENTER_PHOTO_PRINT
|
||||
{
|
||||
box-sizing:border-box;
|
||||
padding:2px;
|
||||
|
@ -2050,7 +2047,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
|
|||
text-align:center;
|
||||
}
|
||||
|
||||
/********** Title of country, institution, centre, degree, course ************/
|
||||
/********** Title of country, institution, center, degree, course ************/
|
||||
.TITLE_LOCATION
|
||||
{
|
||||
color:#808080;
|
||||
|
@ -2104,7 +2101,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
|
|||
vertical-align:middle;
|
||||
}
|
||||
|
||||
/******************* Web of institution, centre, degree **********************/
|
||||
/******************* Web of institution, center, degree **********************/
|
||||
.EXTERNAL_WWW_SHORT
|
||||
{
|
||||
box-sizing:border-box;
|
||||
|
@ -4098,7 +4095,7 @@ a.PAG:hover, .PAG_CUR
|
|||
max-width:500px;
|
||||
}
|
||||
|
||||
/************* Forms to edit institution, centre, degree, course *************/
|
||||
/************* Forms to edit institution, center, degree, course *************/
|
||||
.CODE
|
||||
{
|
||||
box-sizing:border-box;
|
|
@ -7237,8 +7237,8 @@ typedef enum {FORUM_COURSE_USRS = 0 --> 0,
|
|||
FORUM_COURSE_TCHS = 1 --> 1,
|
||||
FORUM_DEGREE_USRS = 2 --> 2,
|
||||
FORUM_DEGREE_TCHS = 3 --> 3,
|
||||
FORUM_CENTRE_USRS = 4 --> 4, // Not used
|
||||
FORUM_CENTRE_TCHS = 5 --> 5, // Not used
|
||||
FORUM_CENTER_USRS = 4 --> 4, // Not used
|
||||
FORUM_CENTER_TCHS = 5 --> 5, // Not used
|
||||
FORUM_GLOBAL_USRS = 6 --> 8,
|
||||
FORUM_GLOBAL_TCHS = 7 --> 9,
|
||||
FORUM_SWAD_USRS = 8 --> 10,
|
||||
|
@ -7247,8 +7247,8 @@ typedef enum {FORUM_COURSE_USRS = 0,
|
|||
FORUM_COURSE_TCHS = 1,
|
||||
FORUM_DEGREE_USRS = 2,
|
||||
FORUM_DEGREE_TCHS = 3,
|
||||
FORUM_CENTRE_USRS = 4, // Not used
|
||||
FORUM_CENTRE_TCHS = 5, // Not used
|
||||
FORUM_CENTER_USRS = 4, // Not used
|
||||
FORUM_CENTER_TCHS = 5, // Not used
|
||||
FORUM_INSTITUTION_USRS = 6,
|
||||
FORUM_INSTITUTION_TCHS = 7,
|
||||
FORUM_GLOBAL_USRS = 8,
|
||||
|
|
|
@ -154,7 +154,7 @@ CREATE TABLE IF NOT EXISTS birthdays_today (
|
|||
UNIQUE INDEX(UsrCod),
|
||||
INDEX(Today));
|
||||
--
|
||||
-- Table buildings: buildings in a centre
|
||||
-- Table buildings: buildings in a center
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS buildings (
|
||||
BldCod INT NOT NULL AUTO_INCREMENT,
|
||||
|
@ -165,9 +165,9 @@ CREATE TABLE IF NOT EXISTS buildings (
|
|||
UNIQUE INDEX(BldCod),
|
||||
INDEX(CtrCod));
|
||||
--
|
||||
-- Table centres: centres (faculties, schools...)
|
||||
-- Table ctr_centers: centers (faculties, schools...)
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS centres (
|
||||
CREATE TABLE IF NOT EXISTS ctr_centers (
|
||||
CtrCod INT NOT NULL AUTO_INCREMENT,
|
||||
InsCod INT NOT NULL,
|
||||
PlcCod INT NOT NULL DEFAULT -1,
|
||||
|
@ -1290,7 +1290,7 @@ CREATE TABLE IF NOT EXISTS projects (
|
|||
INDEX(CrsCod,ModifTime),
|
||||
INDEX(CrsCod,DptCod));
|
||||
--
|
||||
-- Table rooms: stores the rooms associated to each centre
|
||||
-- Table rooms: stores the rooms associated to each center
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS rooms (
|
||||
RooCod INT NOT NULL AUTO_INCREMENT,
|
||||
|
|
50
swad_API.c
50
swad_API.c
|
@ -3281,7 +3281,7 @@ int swad__getNotifications (struct soap *soap,
|
|||
extern const char *Txt_Forum;
|
||||
extern const char *Txt_Course;
|
||||
extern const char *Txt_Degree;
|
||||
extern const char *Txt_Centre;
|
||||
extern const char *Txt_Center;
|
||||
extern const char *Txt_Institution;
|
||||
int ReturnCode;
|
||||
MYSQL_RES *mysql_res;
|
||||
|
@ -3427,9 +3427,9 @@ int swad__getNotifications (struct soap *soap,
|
|||
Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[4]);
|
||||
Ins_GetDataOfInstitutionByCod (&Hie.Ins);
|
||||
|
||||
/* Get centre (row[5]) */
|
||||
/* Get center (row[5]) */
|
||||
Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[5]);
|
||||
Ctr_GetDataOfCentreByCod (&Hie.Ctr);
|
||||
Ctr_GetDataOfCenterByCod (&Hie.Ctr);
|
||||
|
||||
/* Get degree (row[6]) */
|
||||
Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[6]);
|
||||
|
@ -3460,7 +3460,7 @@ int swad__getNotifications (struct soap *soap,
|
|||
Txt_Degree,Hie.Deg.ShrtName);
|
||||
else if (Hie.Ctr.CtrCod > 0)
|
||||
sprintf (getNotificationsOut->notificationsArray.__ptr[NumNotif].location,"%s: %s",
|
||||
Txt_Centre,Hie.Ctr.ShrtName);
|
||||
Txt_Center,Hie.Ctr.ShrtName);
|
||||
else if (Hie.Ins.InsCod > 0)
|
||||
sprintf (getNotificationsOut->notificationsArray.__ptr[NumNotif].location,"%s: %s",
|
||||
Txt_Institution,Hie.Ins.ShrtName);
|
||||
|
@ -5992,9 +5992,9 @@ int swad__getLocation (struct soap *soap,
|
|||
"SELECT institutions.InsCod," // row[ 0]
|
||||
"institutions.ShortName," // row[ 1]
|
||||
"institutions.FullName," // row[ 2]
|
||||
"centres.CtrCod," // row[ 3]
|
||||
"centres.ShortName," // row[ 4]
|
||||
"centres.FullName," // row[ 5]
|
||||
"ctr_centers.CtrCod," // row[ 3]
|
||||
"ctr_centers.ShortName," // row[ 4]
|
||||
"ctr_centers.FullName," // row[ 5]
|
||||
"buildings.BldCod," // row[ 6]
|
||||
"buildings.ShortName," // row[ 7]
|
||||
"buildings.FullName," // row[ 8]
|
||||
|
@ -6002,12 +6002,16 @@ int swad__getLocation (struct soap *soap,
|
|||
"rooms.RooCod," // row[10]
|
||||
"rooms.ShortName," // row[11]
|
||||
"rooms.FullName" // row[12]
|
||||
" FROM room_MAC,rooms,buildings,centres,institutions"
|
||||
" FROM room_MAC,"
|
||||
"rooms,"
|
||||
"buildings,"
|
||||
"ctr_centers,"
|
||||
"institutions"
|
||||
" WHERE room_MAC.MAC=%llu"
|
||||
" AND room_MAC.RooCod=rooms.RooCod"
|
||||
" AND rooms.BldCod=buildings.BldCod"
|
||||
" AND buildings.CtrCod=centres.CtrCod"
|
||||
" AND centres.InsCod=institutions.InsCod"
|
||||
" AND buildings.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=institutions.InsCod"
|
||||
" ORDER BY rooms.Capacity," // Get the biggest room
|
||||
"rooms.ShortName"
|
||||
" DESC LIMIT 1",
|
||||
|
@ -6111,14 +6115,14 @@ int swad__getLastLocation (struct soap *soap,
|
|||
"deg_degrees"
|
||||
" WHERE crs_usr.UsrCod=%ld"
|
||||
" AND crs_usr.CrsCod=crs_courses.CrsCod"
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod) AS C1," // centres of my courses
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod) AS C1," // centers of my courses
|
||||
"(SELECT DISTINCT deg_degrees.CtrCod"
|
||||
" FROM crs_usr,"
|
||||
"crs_courses,"
|
||||
"deg_degrees"
|
||||
" WHERE crs_usr.UsrCod=%d"
|
||||
" AND crs_usr.CrsCod=crs_courses.CrsCod"
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod) AS C2" // centres of user's courses
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod) AS C2" // centers of user's courses
|
||||
" WHERE C1.CtrCod=C2.CtrCod",
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
userCode))
|
||||
|
@ -6129,9 +6133,9 @@ int swad__getLastLocation (struct soap *soap,
|
|||
"SELECT institutions.InsCod," // row[ 0]
|
||||
"institutions.ShortName," // row[ 1]
|
||||
"institutions.FullName," // row[ 2]
|
||||
"centres.CtrCod," // row[ 3]
|
||||
"centres.ShortName," // row[ 4]
|
||||
"centres.FullName," // row[ 5]
|
||||
"ctr_centers.CtrCod," // row[ 3]
|
||||
"ctr_centers.ShortName," // row[ 4]
|
||||
"ctr_centers.FullName," // row[ 5]
|
||||
"buildings.BldCod," // row[ 6]
|
||||
"buildings.ShortName," // row[ 7]
|
||||
"buildings.FullName," // row[ 8]
|
||||
|
@ -6140,7 +6144,11 @@ int swad__getLastLocation (struct soap *soap,
|
|||
"rooms.ShortName," // row[11]
|
||||
"rooms.FullName," // row[12]
|
||||
"UNIX_TIMESTAMP(room_check_in.CheckInTime)" // row[13]
|
||||
" FROM room_check_in,rooms,buildings,centres,institutions"
|
||||
" FROM room_check_in,"
|
||||
"rooms,"
|
||||
"buildings,"
|
||||
"ctr_centers,"
|
||||
"institutions"
|
||||
" WHERE room_check_in.UsrCod=%d"
|
||||
" AND room_check_in.ChkCod="
|
||||
"(SELECT ChkCod FROM room_check_in"
|
||||
|
@ -6148,8 +6156,8 @@ int swad__getLastLocation (struct soap *soap,
|
|||
" ORDER BY ChkCod DESC LIMIT 1)" // Faster than SELECT MAX
|
||||
" AND room_check_in.RooCod=rooms.RooCod"
|
||||
" AND rooms.BldCod=buildings.BldCod"
|
||||
" AND buildings.CtrCod=centres.CtrCod"
|
||||
" AND centres.InsCod=institutions.InsCod",
|
||||
" AND buildings.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=institutions.InsCod",
|
||||
userCode,userCode);
|
||||
API_GetDataOfLocation (soap,
|
||||
&(getLastLocationOut->location),
|
||||
|
@ -6188,9 +6196,9 @@ static void API_GetDataOfLocation (struct soap *soap,
|
|||
institutions.InsCod // row[ 0]
|
||||
institutions.ShortName // row[ 1]
|
||||
institutions.FullName // row[ 2]
|
||||
centres.CtrCod // row[ 3]
|
||||
centres.ShortName // row[ 4]
|
||||
centres.FullName // row[ 5]
|
||||
ctr_centers.CtrCod // row[ 3]
|
||||
ctr_centers.ShortName // row[ 4]
|
||||
ctr_centers.FullName // row[ 5]
|
||||
buildings.BldCod // row[ 6]
|
||||
buildings.ShortName // row[ 7]
|
||||
buildings.FullName // row[ 8]
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "swad_banner.h"
|
||||
#include "swad_building.h"
|
||||
#include "swad_calendar.h"
|
||||
#include "swad_centre_config.h"
|
||||
#include "swad_center_config.h"
|
||||
#include "swad_config.h"
|
||||
#include "swad_cookie.h"
|
||||
#include "swad_country.h"
|
||||
|
@ -290,13 +290,13 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
[ActRecInsLog ] = { 699,-1,TabUnk,ActSeeInsInf , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_DATA,Act_BRW_1ST_TAB,InsCfg_ReceiveLogo ,InsCfg_ShowConfiguration ,NULL},
|
||||
[ActRemInsLog ] = {1341,-1,TabUnk,ActSeeInsInf , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_DATA,Act_BRW_1ST_TAB,InsCfg_RemoveLogo ,InsCfg_ShowConfiguration ,NULL},
|
||||
|
||||
[ActEdiCtr ] = { 681,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Ctr_EditCentres ,NULL},
|
||||
[ActEdiCtr ] = { 681,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Ctr_EditCenters ,NULL},
|
||||
[ActReqCtr ] = {1208,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Ctr_ReceiveFormReqCtr ,Ctr_ContEditAfterChgCtr ,NULL},
|
||||
[ActNewCtr ] = { 685,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Ctr_ReceiveFormNewCtr ,Ctr_ContEditAfterChgCtr ,NULL},
|
||||
[ActRemCtr ] = { 686,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Ctr_RemoveCentre ,Ctr_ContEditAfterChgCtr ,NULL},
|
||||
[ActRemCtr ] = { 686,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Ctr_RemoveCenter ,Ctr_ContEditAfterChgCtr ,NULL},
|
||||
[ActChgCtrPlc ] = { 706,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Ctr_ChangeCtrPlc ,Ctr_ContEditAfterChgCtr ,NULL},
|
||||
[ActRenCtrSho ] = { 682,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Ctr_RenameCentreShort ,Ctr_ContEditAfterChgCtr ,NULL},
|
||||
[ActRenCtrFul ] = { 684,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Ctr_RenameCentreFull ,Ctr_ContEditAfterChgCtr ,NULL},
|
||||
[ActRenCtrSho ] = { 682,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Ctr_RenameCenterShort ,Ctr_ContEditAfterChgCtr ,NULL},
|
||||
[ActRenCtrFul ] = { 684,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Ctr_RenameCenterFull ,Ctr_ContEditAfterChgCtr ,NULL},
|
||||
[ActChgCtrWWW ] = { 683,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x3C6, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Ctr_ChangeCtrWWW ,Ctr_ContEditAfterChgCtr ,NULL},
|
||||
[ActChgCtrSta ] = {1209,-1,TabUnk,ActSeeCtr , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Ctr_ChangeCtrStatus ,Ctr_ContEditAfterChgCtr ,NULL},
|
||||
|
||||
|
@ -333,8 +333,8 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
// Actions not in menu:
|
||||
[ActPrnCtrInf ] = {1152,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x3C7, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,CtrCfg_PrintConfiguration ,NULL},
|
||||
[ActChgCtrInsCfg ] = {1589,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x200, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,CtrCfg_ChangeCtrIns ,CtrCfg_ContEditAfterChgCtr ,NULL},
|
||||
[ActRenCtrShoCfg ] = {1595,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x300, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,CtrCfg_RenameCentreShort ,CtrCfg_ContEditAfterChgCtr ,NULL},
|
||||
[ActRenCtrFulCfg ] = {1594,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x300, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,CtrCfg_RenameCentreFull ,CtrCfg_ContEditAfterChgCtr ,NULL},
|
||||
[ActRenCtrShoCfg ] = {1595,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x300, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,CtrCfg_RenameCenterShort ,CtrCfg_ContEditAfterChgCtr ,NULL},
|
||||
[ActRenCtrFulCfg ] = {1594,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x300, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,CtrCfg_RenameCenterFull ,CtrCfg_ContEditAfterChgCtr ,NULL},
|
||||
[ActChgCtrPlcCfg ] = {1648,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x380, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,CtrCfg_ChangeCtrPlc ,NULL},
|
||||
[ActChgCtrLatCfg ] = {1815,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x380, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,CtrCfg_ChangeCtrLatitude ,NULL},
|
||||
[ActChgCtrLgtCfg ] = {1816,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x380, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,CtrCfg_ChangeCtrLongitude ,NULL},
|
||||
|
@ -1790,7 +1790,7 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
|
||||
[ActChgCtyMyIns ] = {1166,-1,TabUnk,ActReqEdiRecSha ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_ChgCountryOfMyInstitution ,NULL},
|
||||
[ActChgMyIns ] = {1167,-1,TabUnk,ActReqEdiRecSha ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_UpdateMyInstitution ,NULL},
|
||||
[ActChgMyCtr ] = {1168,-1,TabUnk,ActReqEdiRecSha ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_UpdateMyCentre ,NULL},
|
||||
[ActChgMyCtr ] = {1168,-1,TabUnk,ActReqEdiRecSha ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_UpdateMyCenter ,NULL},
|
||||
[ActChgMyDpt ] = {1169,-1,TabUnk,ActReqEdiRecSha ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_UpdateMyDepartment ,NULL},
|
||||
[ActChgMyOff ] = {1170,-1,TabUnk,ActReqEdiRecSha ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_UpdateMyOffice ,NULL},
|
||||
[ActChgMyOffPho ] = {1171,-1,TabUnk,ActReqEdiRecSha ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_UpdateMyOfficePhone ,NULL},
|
||||
|
@ -3821,7 +3821,7 @@ bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action)
|
|||
case Hie_Lvl_INS: // Institution selected
|
||||
Permission = Act_Actions[Action].PermissionIns;
|
||||
break;
|
||||
case Hie_Lvl_CTR: // Centre selected
|
||||
case Hie_Lvl_CTR: // Center selected
|
||||
Permission = Act_Actions[Action].PermissionCtr;
|
||||
break;
|
||||
case Hie_Lvl_DEG: // Degree selected
|
||||
|
@ -3988,7 +3988,7 @@ void Act_AdjustActionWhenNoUsrLogged (void)
|
|||
[Hie_Lvl_SYS] = ActFrmLogIn, // System
|
||||
[Hie_Lvl_CTY] = ActSeeCtyInf, // Country
|
||||
[Hie_Lvl_INS] = ActSeeInsInf, // Institution
|
||||
[Hie_Lvl_CTR] = ActSeeCtrInf, // Centre
|
||||
[Hie_Lvl_CTR] = ActSeeCtrInf, // Center
|
||||
[Hie_Lvl_DEG] = ActSeeDegInf, // Degree
|
||||
[Hie_Lvl_CRS] = ActSeeCrsInf, // Course
|
||||
};
|
||||
|
@ -4078,7 +4078,7 @@ void Act_AdjustCurrentAction (void)
|
|||
- my country
|
||||
- my institution
|
||||
or if I'm a teacher and I haven't filled
|
||||
- my centre
|
||||
- my center
|
||||
- my department,
|
||||
the only action possible
|
||||
is to show a form to change my shared record card *****/
|
||||
|
|
|
@ -288,7 +288,7 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
|
|||
#define ActRenHld (ActChgInsSta + 42)
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************************* Centre tab ********************************/
|
||||
/********************************* Center tab ********************************/
|
||||
/*****************************************************************************/
|
||||
// Actions in menu
|
||||
#define ActSeeCtrInf (ActRenHld + 1)
|
||||
|
|
|
@ -1866,14 +1866,14 @@ unsigned Agd_GetNumUsrsWithEvents (Hie_Lvl_Level_t Scope)
|
|||
DB_QuerySELECT (&mysql_res,"can not get number of users with events",
|
||||
"SELECT COUNT(DISTINCT agendas.UsrCod)"
|
||||
" FROM institutions,"
|
||||
"centres,"
|
||||
"ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"crs_usr,"
|
||||
"agendas"
|
||||
" WHERE institutions.CtyCod=%ld"
|
||||
" AND institutions.InsCod=centres.InsCod"
|
||||
" AND centres.CtrCod=deg_degrees.CtrCod"
|
||||
" AND institutions.InsCod=ctr_centers.InsCod"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.Status=0"
|
||||
" AND crs_courses.CrsCod=crs_usr.CrsCod"
|
||||
|
@ -1883,13 +1883,13 @@ unsigned Agd_GetNumUsrsWithEvents (Hie_Lvl_Level_t Scope)
|
|||
case Hie_Lvl_INS:
|
||||
DB_QuerySELECT (&mysql_res,"can not get number of users with events",
|
||||
"SELECT COUNT(DISTINCT agendas.UsrCod)"
|
||||
" FROM centres,"
|
||||
" FROM ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"crs_usr,"
|
||||
"agendas"
|
||||
" WHERE centres.InsCod=%ld"
|
||||
" AND centres.CtrCod=deg_degrees.CtrCod"
|
||||
" WHERE ctr_centers.InsCod=%ld"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.Status=0"
|
||||
" AND crs_courses.CrsCod=crs_usr.CrsCod"
|
||||
|
@ -1970,14 +1970,14 @@ unsigned Agd_GetNumEvents (Hie_Lvl_Level_t Scope)
|
|||
DB_QuerySELECT (&mysql_res,"can not get number of events",
|
||||
"SELECT COUNT(*)"
|
||||
" FROM institutions,"
|
||||
"centres,"
|
||||
"ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"crs_usr,"
|
||||
"agendas"
|
||||
" WHERE institutions.CtyCod=%ld"
|
||||
" AND institutions.InsCod=centres.InsCod"
|
||||
" AND centres.CtrCod=deg_degrees.CtrCod"
|
||||
" AND institutions.InsCod=ctr_centers.InsCod"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=crs_usr.CrsCod"
|
||||
" AND crs_usr.UsrCod=agendas.UsrCod",
|
||||
|
@ -1986,13 +1986,13 @@ unsigned Agd_GetNumEvents (Hie_Lvl_Level_t Scope)
|
|||
case Hie_Lvl_INS:
|
||||
DB_QuerySELECT (&mysql_res,"can not get number of events",
|
||||
"SELECT COUNT(*)"
|
||||
" FROM centres,"
|
||||
" FROM ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"crs_usr,"
|
||||
"agendas"
|
||||
" WHERE centres.InsCod=%ld"
|
||||
" AND centres.CtrCod=deg_degrees.CtrCod"
|
||||
" WHERE ctr_centers.InsCod=%ld"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=crs_usr.CrsCod"
|
||||
" AND crs_usr.UsrCod=agendas.UsrCod",
|
||||
|
|
|
@ -1841,13 +1841,13 @@ unsigned Asg_GetNumCoursesWithAssignments (Hie_Lvl_Level_t Scope)
|
|||
DB_QuerySELECT (&mysql_res,"can not get number of courses with assignments",
|
||||
"SELECT COUNT(DISTINCT assignments.CrsCod)"
|
||||
" FROM institutions,"
|
||||
"centres,"
|
||||
"ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"courses,"
|
||||
"assignments"
|
||||
" WHERE institutions.CtyCod=%ld"
|
||||
" AND institutions.InsCod=centres.InsCod"
|
||||
" AND centres.CtrCod=deg_degrees.CtrCod"
|
||||
" AND institutions.InsCod=ctr_centers.InsCod"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.Status=0"
|
||||
" AND crs_courses.CrsCod=assignments.CrsCod",
|
||||
|
@ -1856,12 +1856,12 @@ unsigned Asg_GetNumCoursesWithAssignments (Hie_Lvl_Level_t Scope)
|
|||
case Hie_Lvl_INS:
|
||||
DB_QuerySELECT (&mysql_res,"can not get number of courses with assignments",
|
||||
"SELECT COUNT(DISTINCT assignments.CrsCod)"
|
||||
" FROM centres,"
|
||||
" FROM ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"assignments"
|
||||
" WHERE centres.InsCod=%ld"
|
||||
" AND centres.CtrCod=deg_degrees.CtrCod"
|
||||
" WHERE ctr_centers.InsCod=%ld"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.Status=0"
|
||||
" AND crs_courses.CrsCod=assignments.CrsCod",
|
||||
|
@ -1939,13 +1939,13 @@ unsigned Asg_GetNumAssignments (Hie_Lvl_Level_t Scope,unsigned *NumNotif)
|
|||
"SELECT COUNT(*)," // row[0]
|
||||
"SUM(assignments.NumNotif)" // row[1]
|
||||
" FROM institutions,"
|
||||
"centres,"
|
||||
"ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"assignments"
|
||||
" WHERE institutions.CtyCod=%ld"
|
||||
" AND institutions.InsCod=centres.InsCod"
|
||||
" AND centres.CtrCod=deg_degrees.CtrCod"
|
||||
" AND institutions.InsCod=ctr_centers.InsCod"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=assignments.CrsCod",
|
||||
Gbl.Hierarchy.Cty.CtyCod);
|
||||
|
@ -1954,12 +1954,12 @@ unsigned Asg_GetNumAssignments (Hie_Lvl_Level_t Scope,unsigned *NumNotif)
|
|||
DB_QuerySELECT (&mysql_res,"can not get number of assignments",
|
||||
"SELECT COUNT(*)," // row[0]
|
||||
"SUM(assignments.NumNotif)" // row[1]
|
||||
" FROM centres,"
|
||||
" FROM ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"assignments"
|
||||
" WHERE centres.InsCod=%ld"
|
||||
" AND centres.CtrCod=deg_degrees.CtrCod"
|
||||
" WHERE ctr_centers.InsCod=%ld"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=assignments.CrsCod",
|
||||
Gbl.Hierarchy.Ins.InsCod);
|
||||
|
|
|
@ -1706,12 +1706,12 @@ unsigned Att_GetNumCoursesWithAttEvents (Hie_Lvl_Level_t Scope)
|
|||
case Hie_Lvl_INS:
|
||||
DB_QuerySELECT (&mysql_res,"can not get number of courses with attendance events",
|
||||
"SELECT COUNT(DISTINCT att_events.CrsCod)"
|
||||
" FROM centres,"
|
||||
" FROM ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"att_events"
|
||||
" WHERE centres.InsCod=%ld"
|
||||
" AND centres.CtrCod=deg_degrees.CtrCod"
|
||||
" WHERE ctr_centers.InsCod=%ld"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.Status=0"
|
||||
" AND crs_courses.CrsCod=att_events.CrsCod",
|
||||
|
@ -1787,12 +1787,12 @@ unsigned Att_GetNumAttEvents (Hie_Lvl_Level_t Scope,unsigned *NumNotif)
|
|||
DB_QuerySELECT (&mysql_res,"can not get number of attendance events",
|
||||
"SELECT COUNT(*),"
|
||||
"SUM(att_events.NumNotif)"
|
||||
" FROM centres,"
|
||||
" FROM ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"att_events"
|
||||
" WHERE centres.InsCod=%ld"
|
||||
" AND centres.CtrCod=deg_degrees.CtrCod"
|
||||
" WHERE ctr_centers.InsCod=%ld"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=att_events.CrsCod",
|
||||
Gbl.Hierarchy.Ins.InsCod);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// swad_building.c: buildings in a centre
|
||||
// swad_building.c: buildings in a center
|
||||
|
||||
/*
|
||||
SWAD (Shared Workspace At a Distance),
|
||||
|
@ -99,7 +99,7 @@ void Bld_ResetBuildings (struct Bld_Buildings *Buildings)
|
|||
|
||||
void Bld_SeeBuildings (void)
|
||||
{
|
||||
extern const char *Hlp_CENTRE_Buildings;
|
||||
extern const char *Hlp_CENTER_Buildings;
|
||||
extern const char *Txt_Buildings;
|
||||
extern const char *Txt_BUILDINGS_HELP_ORDER[Bld_NUM_ORDERS];
|
||||
extern const char *Txt_BUILDINGS_ORDER[Bld_NUM_ORDERS];
|
||||
|
@ -110,7 +110,7 @@ void Bld_SeeBuildings (void)
|
|||
unsigned RowEvenOdd;
|
||||
|
||||
/***** Trivial check *****/
|
||||
if (Gbl.Hierarchy.Ctr.CtrCod <= 0) // No centre selected
|
||||
if (Gbl.Hierarchy.Ctr.CtrCod <= 0) // No center selected
|
||||
return;
|
||||
|
||||
/***** Reset buildings context *****/
|
||||
|
@ -125,7 +125,7 @@ void Bld_SeeBuildings (void)
|
|||
/***** Table head *****/
|
||||
Box_BoxBegin (NULL,Txt_Buildings,
|
||||
Bld_PutIconsListingBuildings,NULL,
|
||||
Hlp_CENTRE_Buildings,Box_NOT_CLOSABLE);
|
||||
Hlp_CENTER_Buildings,Box_NOT_CLOSABLE);
|
||||
HTM_TABLE_BeginWideMarginPadding (2);
|
||||
HTM_TR_Begin (NULL);
|
||||
for (Order = (Bld_Order_t) 0;
|
||||
|
@ -250,7 +250,7 @@ void Bld_EditBuildings (void)
|
|||
|
||||
static void Bld_EditBuildingsInternal (void)
|
||||
{
|
||||
extern const char *Hlp_CENTRE_Buildings_edit;
|
||||
extern const char *Hlp_CENTER_Buildings_edit;
|
||||
extern const char *Txt_Buildings;
|
||||
struct Bld_Buildings Buildings;
|
||||
|
||||
|
@ -263,7 +263,7 @@ static void Bld_EditBuildingsInternal (void)
|
|||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Txt_Buildings,
|
||||
Bld_PutIconsEditingBuildings,NULL,
|
||||
Hlp_CENTRE_Buildings_edit,Box_NOT_CLOSABLE);
|
||||
Hlp_CENTER_Buildings_edit,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Put a form to create a new building *****/
|
||||
Bld_PutFormToCreateBuilding ();
|
||||
|
@ -354,7 +354,7 @@ void Bld_GetListBuildings (struct Bld_Buildings *Buildings,
|
|||
{
|
||||
Buildings->Num = (unsigned) NumRows;
|
||||
|
||||
/***** Create list with courses in centre *****/
|
||||
/***** Create list with courses in center *****/
|
||||
if ((Buildings->Lst = calloc (NumRows,sizeof (*Buildings->Lst))) == NULL)
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
|
||||
|
@ -584,12 +584,12 @@ void Bld_RemoveBuilding (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Remove all buildings in a centre ***********************/
|
||||
/******************** Remove all buildings in a center ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Bld_RemoveAllBuildingsInCtr (long CtrCod)
|
||||
{
|
||||
/***** Remove all buildings in centre *****/
|
||||
/***** Remove all buildings in center *****/
|
||||
DB_QueryDELETE ("can not remove buildings",
|
||||
"DELETE FROM buildings"
|
||||
" WHERE CtrCod=%ld",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// swad_building.h: buildings in a centre
|
||||
// swad_building.h: buildings in a center
|
||||
|
||||
#ifndef _SWAD_BLD
|
||||
#define _SWAD_BLD
|
||||
|
@ -48,7 +48,7 @@ struct Bld_Building
|
|||
long InsCod;
|
||||
char ShrtName[Bld_MAX_BYTES_SHRT_NAME + 1];
|
||||
char FullName[Bld_MAX_BYTES_FULL_NAME + 1];
|
||||
char Location[Bld_MAX_BYTES_LOCATION + 1]; // Examples: Campus North, City centre
|
||||
char Location[Bld_MAX_BYTES_LOCATION + 1]; // Examples: Campus North, City center
|
||||
};
|
||||
|
||||
#define Bld_NUM_ORDERS 3
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
// swad_centre.h: centres
|
||||
// swad_center.h: centers
|
||||
|
||||
#ifndef _SWAD_CTR
|
||||
#define _SWAD_CTR
|
||||
|
@ -41,8 +41,8 @@
|
|||
|
||||
typedef enum
|
||||
{
|
||||
Ctr_STATUS_BIT_PENDING = (1 << 0), // Centre is requested, but not yet activated
|
||||
Ctr_STATUS_BIT_REMOVED = (1 << 1), // Centre has been removed
|
||||
Ctr_STATUS_BIT_PENDING = (1 << 0), // Center is requested, but not yet activated
|
||||
Ctr_STATUS_BIT_REMOVED = (1 << 1), // Center has been removed
|
||||
} Ctr_Status_Bits_t;
|
||||
|
||||
typedef unsigned Ctr_Status_t;
|
||||
|
@ -58,15 +58,15 @@ typedef enum
|
|||
Ctr_STATUS_REMOVED = 3, // 1- (Status & Ctr_STATUS_BIT_REMOVED)
|
||||
} Ctr_StatusTxt_t;
|
||||
|
||||
#define Ctr_MAX_CENTRES_PER_USR 10 // Used in list of my centres
|
||||
#define Ctr_MAX_CENTERS_PER_USR 10 // Used in list of my centers
|
||||
|
||||
struct Ctr_Centre
|
||||
struct Ctr_Center
|
||||
{
|
||||
long CtrCod; // Centre code
|
||||
long CtrCod; // Center code
|
||||
long InsCod; // Institution code
|
||||
long PlcCod; // Place code
|
||||
Ctr_Status_t Status; // Centre status
|
||||
long RequesterUsrCod; // User code of the person who requested the creation of this centre
|
||||
Ctr_Status_t Status; // Center status
|
||||
long RequesterUsrCod; // User code of the person who requested the creation of this center
|
||||
struct Coordinates Coord; // Geographical coordinates
|
||||
char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1];
|
||||
char FullName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1];
|
||||
|
@ -81,16 +81,16 @@ struct Ctr_Centre
|
|||
#define Ctr_NUM_ORDERS 2
|
||||
typedef enum
|
||||
{
|
||||
Ctr_ORDER_BY_CENTRE = 0,
|
||||
Ctr_ORDER_BY_CENTER = 0,
|
||||
Ctr_ORDER_BY_NUM_USRS = 1,
|
||||
} Ctr_Order_t;
|
||||
#define Ctr_ORDER_DEFAULT Ctr_ORDER_BY_CENTRE
|
||||
#define Ctr_ORDER_DEFAULT Ctr_ORDER_BY_CENTER
|
||||
|
||||
struct ListCentres
|
||||
struct ListCenters
|
||||
{
|
||||
unsigned Num; // Number of centres
|
||||
struct Ctr_Centre *Lst; // List of centres
|
||||
Ctr_Order_t SelectedOrder; // Order of centres
|
||||
unsigned Num; // Number of centers
|
||||
struct Ctr_Center *Lst; // List of centers
|
||||
Ctr_Order_t SelectedOrder; // Order of centers
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -99,29 +99,29 @@ struct ListCentres
|
|||
|
||||
void Ctr_SeeCtrWithPendingDegs (void);
|
||||
|
||||
void Ctr_DrawCentreLogoAndNameWithLink (struct Ctr_Centre *Ctr,Act_Action_t Action,
|
||||
void Ctr_DrawCenterLogoAndNameWithLink (struct Ctr_Center *Ctr,Act_Action_t Action,
|
||||
const char *ClassLink,const char *ClassLogo);
|
||||
|
||||
void Ctr_ShowCtrsOfCurrentIns (void);
|
||||
void Ctr_EditCentres (void);
|
||||
void Ctr_EditCenters (void);
|
||||
|
||||
void Ctr_PutIconToViewCentres (void);
|
||||
void Ctr_PutIconToViewCenters (void);
|
||||
|
||||
void Ctr_GetBasicListOfCentres (long InsCod);
|
||||
void Ctr_GetFullListOfCentres (long InsCod);
|
||||
bool Ctr_GetDataOfCentreByCod (struct Ctr_Centre *Ctr);
|
||||
long Ctr_GetInsCodOfCentreByCod (long CtrCod);
|
||||
void Ctr_GetShortNameOfCentreByCod (struct Ctr_Centre *Ctr);
|
||||
void Ctr_FreeListCentres (void);
|
||||
void Ctr_WriteSelectorOfCentre (void);
|
||||
void Ctr_GetBasicListOfCenters (long InsCod);
|
||||
void Ctr_GetFullListOfCenters (long InsCod);
|
||||
bool Ctr_GetDataOfCenterByCod (struct Ctr_Center *Ctr);
|
||||
long Ctr_GetInsCodOfCenterByCod (long CtrCod);
|
||||
void Ctr_GetShortNameOfCenterByCod (struct Ctr_Center *Ctr);
|
||||
void Ctr_FreeListCenters (void);
|
||||
void Ctr_WriteSelectorOfCenter (void);
|
||||
void Ctr_PutParamCtrCod (long CtrCod);
|
||||
long Ctr_GetAndCheckParamOtherCtrCod (long MinCodAllowed);
|
||||
void Ctr_RemoveCentre (void);
|
||||
void Ctr_RemoveCenter (void);
|
||||
void Ctr_ChangeCtrPlc (void);
|
||||
void Ctr_UpdateCtrPlcDB (long CtrCod,long NewPlcCod);
|
||||
void Ctr_RenameCentreShort (void);
|
||||
void Ctr_RenameCentreFull (void);
|
||||
void Ctr_RenameCentre (struct Ctr_Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName);
|
||||
void Ctr_RenameCenterShort (void);
|
||||
void Ctr_RenameCenterFull (void);
|
||||
void Ctr_RenameCenter (struct Ctr_Center *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName);
|
||||
bool Ctr_CheckIfCtrNameExistsInIns (const char *FieldName,const char *Name,
|
||||
long CtrCod,long InsCod);
|
||||
void Ctr_ChangeCtrWWW (void);
|
||||
|
@ -156,6 +156,6 @@ unsigned Ctr_GetCachedNumCtrsWithUsrs (Rol_Role_t Role,const char *SubQuery,
|
|||
|
||||
void Ctr_ListCtrsFound (MYSQL_RES **mysql_res,unsigned NumCtrs);
|
||||
|
||||
bool Ctr_GetIfMapIsAvailable (const struct Ctr_Centre *Ctr);
|
||||
bool Ctr_GetIfMapIsAvailable (const struct Ctr_Center *Ctr);
|
||||
|
||||
#endif
|
|
@ -1,4 +1,4 @@
|
|||
// swad_centre_config.c: configuration of current centre
|
||||
// swad_center_config.c: configuration of current center
|
||||
|
||||
/*
|
||||
SWAD (Shared Workspace At a Distance),
|
||||
|
@ -33,7 +33,7 @@
|
|||
#include <string.h> // For string functions
|
||||
#include <unistd.h> // For unlink
|
||||
|
||||
#include "swad_centre.h"
|
||||
#include "swad_center.h"
|
||||
#include "swad_database.h"
|
||||
#include "swad_figure_cache.h"
|
||||
#include "swad_form.h"
|
||||
|
@ -55,7 +55,7 @@ extern struct Globals Gbl;
|
|||
/***************************** Private constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
// Centre photo will be saved with:
|
||||
// Center photo will be saved with:
|
||||
// - maximum width of Ctr_PHOTO_SAVED_MAX_HEIGHT
|
||||
// - maximum height of Ctr_PHOTO_SAVED_MAX_HEIGHT
|
||||
// - maintaining the original aspect ratio (aspect ratio recommended: 3:2)
|
||||
|
@ -104,7 +104,7 @@ static void CtrCfg_UpdateCtrCoordinateDB (long CtrCod,
|
|||
const char *CoordField,double NewCoord);
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************** Show information of the current centre *******************/
|
||||
/****************** Show information of the current center *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void CtrCfg_ShowConfiguration (void)
|
||||
|
@ -116,7 +116,7 @@ void CtrCfg_ShowConfiguration (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************** Print information of the current centre ******************/
|
||||
/****************** Print information of the current center ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void CtrCfg_PrintConfiguration (void)
|
||||
|
@ -125,12 +125,12 @@ void CtrCfg_PrintConfiguration (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* Information of the current centre ***********************/
|
||||
/******************* Information of the current center ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Configuration (bool PrintView)
|
||||
{
|
||||
extern const char *Hlp_CENTRE_Information;
|
||||
extern const char *Hlp_CENTER_Information;
|
||||
bool PutLink;
|
||||
bool PutFormIns;
|
||||
bool PutFormName;
|
||||
|
@ -143,7 +143,7 @@ static void CtrCfg_Configuration (bool PrintView)
|
|||
bool PhotoExists;
|
||||
|
||||
/***** Trivial check *****/
|
||||
if (Gbl.Hierarchy.Ctr.CtrCod <= 0) // No centre selected
|
||||
if (Gbl.Hierarchy.Ctr.CtrCod <= 0) // No center selected
|
||||
return;
|
||||
|
||||
/***** Initializations *****/
|
||||
|
@ -163,7 +163,7 @@ static void CtrCfg_Configuration (bool PrintView)
|
|||
else
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
CtrCfg_PutIconsCtrConfig,NULL,
|
||||
Hlp_CENTRE_Information,Box_NOT_CLOSABLE);
|
||||
Hlp_CENTER_Information,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Title *****/
|
||||
CtrCfg_Title (PutLink);
|
||||
|
@ -177,7 +177,7 @@ static void CtrCfg_Configuration (bool PrintView)
|
|||
/***** Institution *****/
|
||||
CtrCfg_Institution (PrintView,PutFormIns);
|
||||
|
||||
/***** Centre name *****/
|
||||
/***** Center name *****/
|
||||
CtrCfg_FullName (PutFormName);
|
||||
CtrCfg_ShrtName (PutFormName);
|
||||
|
||||
|
@ -192,25 +192,25 @@ static void CtrCfg_Configuration (bool PrintView)
|
|||
CtrCfg_Altitude ();
|
||||
}
|
||||
|
||||
/***** Centre WWW *****/
|
||||
/***** Center WWW *****/
|
||||
CtrCfg_WWW (PrintView,PutFormWWW);
|
||||
|
||||
/***** Shortcut to the centre *****/
|
||||
/***** Shortcut to the center *****/
|
||||
CtrCfg_Shortcut (PrintView);
|
||||
|
||||
if (PrintView)
|
||||
/***** QR code with link to the centre *****/
|
||||
/***** QR code with link to the center *****/
|
||||
CtrCfg_QR ();
|
||||
else
|
||||
{
|
||||
/***** Number of users who claim to belong to this centre,
|
||||
/***** Number of users who claim to belong to this center,
|
||||
number of degrees,
|
||||
number of courses *****/
|
||||
CtrCfg_NumUsrs ();
|
||||
CtrCfg_NumDegs ();
|
||||
CtrCfg_NumCrss ();
|
||||
|
||||
/***** Number of users in courses of this centre *****/
|
||||
/***** Number of users in courses of this center *****/
|
||||
HieCfg_NumUsrsInCrss (Hie_Lvl_CTR,Gbl.Hierarchy.Ctr.CtrCod,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_Lvl_CTR,Gbl.Hierarchy.Ctr.CtrCod,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_Lvl_CTR,Gbl.Hierarchy.Ctr.CtrCod,Rol_STD);
|
||||
|
@ -239,11 +239,11 @@ static void CtrCfg_Configuration (bool PrintView)
|
|||
{
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\"");
|
||||
|
||||
/***** Centre map *****/
|
||||
/***** Center map *****/
|
||||
if (MapIsAvailable)
|
||||
CtrCfg_Map ();
|
||||
|
||||
/***** Centre photo *****/
|
||||
/***** Center photo *****/
|
||||
if (PhotoExists)
|
||||
CtrCfg_Photo (PrintView,PutFormPhoto,PutLink,PathPhoto);
|
||||
|
||||
|
@ -255,12 +255,12 @@ static void CtrCfg_Configuration (bool PrintView)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************ Put contextual icons in configuration of a centre **************/
|
||||
/************ Put contextual icons in configuration of a center **************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_PutIconsCtrConfig (__attribute__((unused)) void *Args)
|
||||
{
|
||||
/***** Put icon to print info about centre *****/
|
||||
/***** Put icon to print info about center *****/
|
||||
Ico_PutContextualIconToPrint (ActPrnCtrInf,
|
||||
NULL,NULL);
|
||||
|
||||
|
@ -268,19 +268,19 @@ static void CtrCfg_PutIconsCtrConfig (__attribute__((unused)) void *Args)
|
|||
Plc_PutIconToViewPlaces ();
|
||||
|
||||
if (Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM)
|
||||
// Only centre admins, institution admins and system admins
|
||||
// have permission to upload logo and photo of the centre
|
||||
// Only center admins, institution admins and system admins
|
||||
// have permission to upload logo and photo of the center
|
||||
{
|
||||
/***** Put icon to upload logo of centre *****/
|
||||
/***** Put icon to upload logo of center *****/
|
||||
Lgo_PutIconToChangeLogo (Hie_Lvl_CTR);
|
||||
|
||||
/***** Put icon to upload photo of centre *****/
|
||||
/***** Put icon to upload photo of center *****/
|
||||
CtrCfg_PutIconToChangePhoto ();
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************* Put contextual icons to upload photo of centre ****************/
|
||||
/************* Put contextual icons to upload photo of center ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_PutIconToChangePhoto (void)
|
||||
|
@ -290,7 +290,7 @@ static void CtrCfg_PutIconToChangePhoto (void)
|
|||
char PathPhoto[PATH_MAX + 1];
|
||||
bool PhotoExists;
|
||||
|
||||
/***** Link to upload photo of centre *****/
|
||||
/***** Link to upload photo of center *****/
|
||||
snprintf (PathPhoto,sizeof (PathPhoto),"%s/%02u/%u/%u.jpg",
|
||||
Cfg_PATH_CTR_PUBLIC,
|
||||
(unsigned) (Gbl.Hierarchy.Ctr.CtrCod % 100),
|
||||
|
@ -305,7 +305,7 @@ static void CtrCfg_PutIconToChangePhoto (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Show title in centre configuration *********************/
|
||||
/******************** Show title in center configuration *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Title (bool PutLink)
|
||||
|
@ -320,7 +320,7 @@ static void CtrCfg_Title (bool PutLink)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************************** Draw centre map ******************************/
|
||||
/****************************** Draw center map ******************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define CtrCfg_MAP_CONTAINER_ID "ctr_mapid"
|
||||
|
@ -357,7 +357,7 @@ static void CtrCfg_Map (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************** Edit centre coordinates **************************/
|
||||
/************************** Edit center coordinates **************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Latitude (void)
|
||||
|
@ -436,7 +436,7 @@ static void CtrCfg_Altitude (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************************** Draw centre photo *****************************/
|
||||
/***************************** Draw center photo *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Photo (bool PrintView,bool PutForm,bool PutLink,
|
||||
|
@ -469,8 +469,8 @@ static void CtrCfg_Photo (bool PrintView,bool PutForm,bool PutLink,
|
|||
(unsigned) Gbl.Hierarchy.Ctr.CtrCod) < 0)
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
HTM_IMG (URL,Icon,Gbl.Hierarchy.Ctr.FullName,
|
||||
"class=\"%s\"",PrintView ? "CENTRE_PHOTO_PRINT CENTRE_PHOTO_WIDTH" :
|
||||
"CENTRE_PHOTO_SHOW CENTRE_PHOTO_WIDTH");
|
||||
"class=\"%s\"",PrintView ? "CENTER_PHOTO_PRINT CENTER_PHOTO_WIDTH" :
|
||||
"CENTER_PHOTO_SHOW CENTER_PHOTO_WIDTH");
|
||||
free (Icon);
|
||||
free (URL);
|
||||
if (PutLink)
|
||||
|
@ -517,14 +517,14 @@ static void CtrCfg_GetPhotoAttr (long CtrCod,char **PhotoAttribution)
|
|||
|
||||
/***** Get photo attribution from database *****/
|
||||
if (DB_QuerySELECT (&mysql_res,"can not get photo attribution",
|
||||
"SELECT PhotoAttribution"
|
||||
" FROM centres WHERE CtrCod=%ld",
|
||||
"SELECT PhotoAttribution FROM ctr_centers"
|
||||
" WHERE CtrCod=%ld",
|
||||
CtrCod))
|
||||
{
|
||||
/* Get row */
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
|
||||
/* Get the attribution of the photo of the centre (row[0]) */
|
||||
/* Get the attribution of the photo of the center (row[0]) */
|
||||
if (row[0])
|
||||
if (row[0][0])
|
||||
{
|
||||
|
@ -553,7 +553,7 @@ static void CtrCfg_FreePhotoAttr (char **PhotoAttribution)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Show institution in centre configuration ******************/
|
||||
/***************** Show institution in center configuration ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Institution (bool PrintView,bool PutForm)
|
||||
|
@ -593,7 +593,7 @@ static void CtrCfg_Institution (bool PrintView,bool PutForm)
|
|||
/* Free list of institutions */
|
||||
Ins_FreeListInstitutions ();
|
||||
}
|
||||
else // I can not move centre to another institution
|
||||
else // I can not move center to another institution
|
||||
{
|
||||
if (!PrintView)
|
||||
{
|
||||
|
@ -619,19 +619,19 @@ static void CtrCfg_Institution (bool PrintView,bool PutForm)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Show centre full name in centre configuration ****************/
|
||||
/************** Show center full name in center configuration ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_FullName (bool PutForm)
|
||||
{
|
||||
extern const char *Txt_Centre;
|
||||
extern const char *Txt_Center;
|
||||
|
||||
HieCfg_FullName (PutForm,Txt_Centre,ActRenCtrFulCfg,
|
||||
HieCfg_FullName (PutForm,Txt_Center,ActRenCtrFulCfg,
|
||||
Gbl.Hierarchy.Ctr.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Show centre short name in centre configuration ***************/
|
||||
/************** Show center short name in center configuration ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_ShrtName (bool PutForm)
|
||||
|
@ -640,7 +640,7 @@ static void CtrCfg_ShrtName (bool PutForm)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************** Show centre place in centre configuration ******************/
|
||||
/**************** Show center place in center configuration ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Place (bool PutForm)
|
||||
|
@ -693,7 +693,7 @@ static void CtrCfg_Place (bool PutForm)
|
|||
/* Free list of places */
|
||||
Plc_FreeListPlaces (&Places);
|
||||
}
|
||||
else // I can not change centre place
|
||||
else // I can not change center place
|
||||
HTM_Txt (Plc.FullName);
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -701,7 +701,7 @@ static void CtrCfg_Place (bool PutForm)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Show centre WWW in centre configuration *******************/
|
||||
/***************** Show center WWW in center configuration *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_WWW (bool PrintView,bool PutForm)
|
||||
|
@ -710,7 +710,7 @@ static void CtrCfg_WWW (bool PrintView,bool PutForm)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*************** Show centre shortcut in centre configuration ****************/
|
||||
/*************** Show center shortcut in center configuration ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Shortcut (bool PrintView)
|
||||
|
@ -719,7 +719,7 @@ static void CtrCfg_Shortcut (bool PrintView)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************** Show centre QR in centre configuration *******************/
|
||||
/****************** Show center QR in center configuration *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_QR (void)
|
||||
|
@ -728,18 +728,18 @@ static void CtrCfg_QR (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** Show number of users who claim to belong to centre in centre config. ****/
|
||||
/*** Show number of users who claim to belong to center in center config. ****/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_NumUsrs (void)
|
||||
{
|
||||
extern const char *Txt_Users_of_the_centre;
|
||||
extern const char *Txt_Users_of_the_center;
|
||||
|
||||
/***** Number of users *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",NULL,Txt_Users_of_the_centre);
|
||||
Frm_LabelColumn ("RT",NULL,Txt_Users_of_the_center);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"DAT LB\"");
|
||||
|
@ -750,13 +750,13 @@ static void CtrCfg_NumUsrs (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Show number of degrees in centre configuration ***************/
|
||||
/************** Show number of degrees in center configuration ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_NumDegs (void)
|
||||
{
|
||||
extern const char *Txt_Degrees;
|
||||
extern const char *Txt_Degrees_of_CENTRE_X;
|
||||
extern const char *Txt_Degrees_of_CENTER_X;
|
||||
|
||||
/***** Number of degrees *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
@ -768,7 +768,7 @@ static void CtrCfg_NumDegs (void)
|
|||
HTM_TD_Begin ("class=\"LB\"");
|
||||
Frm_BeginFormGoTo (ActSeeDeg);
|
||||
Ctr_PutParamCtrCod (Gbl.Hierarchy.Ctr.CtrCod);
|
||||
HTM_BUTTON_SUBMIT_Begin (Str_BuildStringStr (Txt_Degrees_of_CENTRE_X,
|
||||
HTM_BUTTON_SUBMIT_Begin (Str_BuildStringStr (Txt_Degrees_of_CENTER_X,
|
||||
Gbl.Hierarchy.Ctr.ShrtName),
|
||||
"BT_LINK DAT",NULL);
|
||||
Str_FreeString ();
|
||||
|
@ -781,7 +781,7 @@ static void CtrCfg_NumDegs (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Show number of courses in centre configuration ***************/
|
||||
/************** Show number of courses in center configuration ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_NumCrss (void)
|
||||
|
@ -803,7 +803,7 @@ static void CtrCfg_NumCrss (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********** Show a form for sending a logo of the current centre ************/
|
||||
/*********** Show a form for sending a logo of the current center ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void CtrCfg_RequestLogo (void)
|
||||
|
@ -812,7 +812,7 @@ void CtrCfg_RequestLog |