mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-13 20:24:06 +02:00
Version19.94.2
This commit is contained in:
parent
e05a423eb9
commit
3767b1f79e
151
swad_centre.c
151
swad_centre.c
|
@ -86,6 +86,7 @@ static struct Centre *Ctr_EditingCtr = NULL; // Static variable to keep the cent
|
||||||
static void Ctr_Configuration (bool PrintView);
|
static void Ctr_Configuration (bool PrintView);
|
||||||
static void Ctr_PutIconsCtrConfig (void);
|
static void Ctr_PutIconsCtrConfig (void);
|
||||||
static void Ctr_PutIconToChangePhoto (void);
|
static void Ctr_PutIconToChangePhoto (void);
|
||||||
|
static void Ctr_DrawPhoto (bool PrintView,bool PutLink);
|
||||||
static void Ctr_ShowNumUsrsInCrssOfCtr (Rol_Role_t Role);
|
static void Ctr_ShowNumUsrsInCrssOfCtr (Rol_Role_t Role);
|
||||||
|
|
||||||
static void Ctr_ListCentres (void);
|
static void Ctr_ListCentres (void);
|
||||||
|
@ -307,26 +308,12 @@ static void Ctr_Configuration (bool PrintView)
|
||||||
unsigned NumIns;
|
unsigned NumIns;
|
||||||
unsigned NumPlc;
|
unsigned NumPlc;
|
||||||
struct Place Plc;
|
struct Place Plc;
|
||||||
char PathPhoto[PATH_MAX + 1];
|
bool PutLink = !PrintView && Gbl.Hierarchy.Ctr.WWW[0];
|
||||||
bool PhotoExists;
|
|
||||||
char *PhotoAttribution = NULL;
|
|
||||||
bool PutLink;
|
|
||||||
char *URL;
|
|
||||||
char *Icon;
|
|
||||||
|
|
||||||
/***** Trivial check *****/
|
/***** Trivial check *****/
|
||||||
if (Gbl.Hierarchy.Ctr.CtrCod <= 0) // No centre selected
|
if (Gbl.Hierarchy.Ctr.CtrCod <= 0) // No centre selected
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/***** Path to photo *****/
|
|
||||||
snprintf (PathPhoto,sizeof (PathPhoto),
|
|
||||||
"%s/%02u/%u/%u.jpg",
|
|
||||||
Cfg_PATH_CTR_PUBLIC,
|
|
||||||
(unsigned) (Gbl.Hierarchy.Ctr.CtrCod % 100),
|
|
||||||
(unsigned) Gbl.Hierarchy.Ctr.CtrCod,
|
|
||||||
(unsigned) Gbl.Hierarchy.Ctr.CtrCod);
|
|
||||||
PhotoExists = Fil_CheckIfPathExists (PathPhoto);
|
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
if (PrintView)
|
if (PrintView)
|
||||||
Box_BoxBegin (NULL,NULL,NULL,
|
Box_BoxBegin (NULL,NULL,NULL,
|
||||||
|
@ -336,7 +323,6 @@ static void Ctr_Configuration (bool PrintView)
|
||||||
Hlp_CENTRE_Information,Box_NOT_CLOSABLE);
|
Hlp_CENTRE_Information,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Title *****/
|
/***** Title *****/
|
||||||
PutLink = !PrintView && Gbl.Hierarchy.Ctr.WWW[0];
|
|
||||||
HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG\"");
|
HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG\"");
|
||||||
if (PutLink)
|
if (PutLink)
|
||||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\""
|
HTM_A_Begin ("href=\"%s\" target=\"_blank\""
|
||||||
|
@ -352,60 +338,7 @@ static void Ctr_Configuration (bool PrintView)
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
|
|
||||||
/***** Centre photo *****/
|
/***** Centre photo *****/
|
||||||
if (PhotoExists)
|
Ctr_DrawPhoto (PrintView,PutLink);
|
||||||
{
|
|
||||||
/* Get photo attribution */
|
|
||||||
Ctr_GetPhotoAttribution (Gbl.Hierarchy.Ctr.CtrCod,&PhotoAttribution);
|
|
||||||
|
|
||||||
/* Photo image */
|
|
||||||
HTM_DIV_Begin ("class=\"DAT_SMALL CM\"");
|
|
||||||
if (PutLink)
|
|
||||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"DAT_N\"",
|
|
||||||
Gbl.Hierarchy.Ctr.WWW);
|
|
||||||
if (asprintf (&URL,"%s/%02u/%u",
|
|
||||||
Cfg_URL_CTR_PUBLIC,
|
|
||||||
(unsigned) (Gbl.Hierarchy.Ctr.CtrCod % 100),
|
|
||||||
(unsigned) Gbl.Hierarchy.Ctr.CtrCod) < 0)
|
|
||||||
Lay_NotEnoughMemoryExit ();
|
|
||||||
if (asprintf (&Icon,"%u.jpg",
|
|
||||||
(unsigned) Gbl.Hierarchy.Ctr.CtrCod) < 0)
|
|
||||||
Lay_NotEnoughMemoryExit ();
|
|
||||||
HTM_IMG (URL,Icon,Gbl.Hierarchy.Ctr.FullName,
|
|
||||||
"class=\"%s\"",PrintView ? "CENTRE_PHOTO_PRINT" :
|
|
||||||
"CENTRE_PHOTO_SHOW");
|
|
||||||
free (Icon);
|
|
||||||
free (URL);
|
|
||||||
if (PutLink)
|
|
||||||
HTM_A_End ();
|
|
||||||
HTM_DIV_End ();
|
|
||||||
|
|
||||||
/* Photo attribution */
|
|
||||||
if (!PrintView &&
|
|
||||||
Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM)
|
|
||||||
// Only centre admins, institution admins and centre admins
|
|
||||||
// have permission to edit photo attribution
|
|
||||||
{
|
|
||||||
HTM_DIV_Begin ("class=\"CM\"");
|
|
||||||
Frm_StartForm (ActChgCtrPhoAtt);
|
|
||||||
HTM_TEXTAREA_Begin ("id=\"AttributionArea\" name=\"Attribution\" rows=\"2\""
|
|
||||||
" onchange=\"document.getElementById('%s').submit();return false;\"",
|
|
||||||
Gbl.Form.Id);
|
|
||||||
if (PhotoAttribution)
|
|
||||||
HTM_Txt (PhotoAttribution);
|
|
||||||
HTM_TEXTAREA_End ();
|
|
||||||
Frm_EndForm ();
|
|
||||||
HTM_DIV_End ();
|
|
||||||
}
|
|
||||||
else if (PhotoAttribution)
|
|
||||||
{
|
|
||||||
HTM_DIV_Begin ("class=\"ATTRIBUTION\"");
|
|
||||||
HTM_Txt (PhotoAttribution);
|
|
||||||
HTM_DIV_End ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Free memory used for photo attribution */
|
|
||||||
Ctr_FreePhotoAttribution (&PhotoAttribution);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Begin table *****/
|
/***** Begin table *****/
|
||||||
HTM_TABLE_BeginWidePadding (2);
|
HTM_TABLE_BeginWidePadding (2);
|
||||||
|
@ -729,6 +662,84 @@ static void Ctr_PutIconToChangePhoto (void)
|
||||||
Txt_Upload_photo);
|
Txt_Upload_photo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/***************************** Draw centre photo *****************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Ctr_DrawPhoto (bool PrintView,bool PutLink)
|
||||||
|
{
|
||||||
|
char PathPhoto[PATH_MAX + 1];
|
||||||
|
bool PhotoExists;
|
||||||
|
char *PhotoAttribution = NULL;
|
||||||
|
char *URL;
|
||||||
|
char *Icon;
|
||||||
|
|
||||||
|
/***** Path to photo *****/
|
||||||
|
snprintf (PathPhoto,sizeof (PathPhoto),
|
||||||
|
"%s/%02u/%u/%u.jpg",
|
||||||
|
Cfg_PATH_CTR_PUBLIC,
|
||||||
|
(unsigned) (Gbl.Hierarchy.Ctr.CtrCod % 100),
|
||||||
|
(unsigned) Gbl.Hierarchy.Ctr.CtrCod,
|
||||||
|
(unsigned) Gbl.Hierarchy.Ctr.CtrCod);
|
||||||
|
PhotoExists = Fil_CheckIfPathExists (PathPhoto);
|
||||||
|
|
||||||
|
/***** Centre photo *****/
|
||||||
|
if (PhotoExists)
|
||||||
|
{
|
||||||
|
/* Get photo attribution */
|
||||||
|
Ctr_GetPhotoAttribution (Gbl.Hierarchy.Ctr.CtrCod,&PhotoAttribution);
|
||||||
|
|
||||||
|
/* Photo image */
|
||||||
|
HTM_DIV_Begin ("class=\"DAT_SMALL CM\"");
|
||||||
|
if (PutLink)
|
||||||
|
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"DAT_N\"",
|
||||||
|
Gbl.Hierarchy.Ctr.WWW);
|
||||||
|
if (asprintf (&URL,"%s/%02u/%u",
|
||||||
|
Cfg_URL_CTR_PUBLIC,
|
||||||
|
(unsigned) (Gbl.Hierarchy.Ctr.CtrCod % 100),
|
||||||
|
(unsigned) Gbl.Hierarchy.Ctr.CtrCod) < 0)
|
||||||
|
Lay_NotEnoughMemoryExit ();
|
||||||
|
if (asprintf (&Icon,"%u.jpg",
|
||||||
|
(unsigned) Gbl.Hierarchy.Ctr.CtrCod) < 0)
|
||||||
|
Lay_NotEnoughMemoryExit ();
|
||||||
|
HTM_IMG (URL,Icon,Gbl.Hierarchy.Ctr.FullName,
|
||||||
|
"class=\"%s\"",PrintView ? "CENTRE_PHOTO_PRINT" :
|
||||||
|
"CENTRE_PHOTO_SHOW");
|
||||||
|
free (Icon);
|
||||||
|
free (URL);
|
||||||
|
if (PutLink)
|
||||||
|
HTM_A_End ();
|
||||||
|
HTM_DIV_End ();
|
||||||
|
|
||||||
|
/* Photo attribution */
|
||||||
|
if (!PrintView &&
|
||||||
|
Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM)
|
||||||
|
// Only centre admins, institution admins and centre admins
|
||||||
|
// have permission to edit photo attribution
|
||||||
|
{
|
||||||
|
HTM_DIV_Begin ("class=\"CM\"");
|
||||||
|
Frm_StartForm (ActChgCtrPhoAtt);
|
||||||
|
HTM_TEXTAREA_Begin ("id=\"AttributionArea\" name=\"Attribution\" rows=\"2\""
|
||||||
|
" onchange=\"document.getElementById('%s').submit();return false;\"",
|
||||||
|
Gbl.Form.Id);
|
||||||
|
if (PhotoAttribution)
|
||||||
|
HTM_Txt (PhotoAttribution);
|
||||||
|
HTM_TEXTAREA_End ();
|
||||||
|
Frm_EndForm ();
|
||||||
|
HTM_DIV_End ();
|
||||||
|
}
|
||||||
|
else if (PhotoAttribution)
|
||||||
|
{
|
||||||
|
HTM_DIV_Begin ("class=\"ATTRIBUTION\"");
|
||||||
|
HTM_Txt (PhotoAttribution);
|
||||||
|
HTM_DIV_End ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Free memory used for photo attribution */
|
||||||
|
Ctr_FreePhotoAttribution (&PhotoAttribution);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**************** Number of users in courses of this centre ******************/
|
/**************** Number of users in courses of this centre ******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -490,13 +490,15 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
||||||
En OpenSWAD:
|
En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 19.94.1 (2019-12-17)"
|
#define Log_PLATFORM_VERSION "SWAD 19.94.2 (2019-12-17)"
|
||||||
#define CSS_FILE "swad19.90.1.css"
|
#define CSS_FILE "swad19.90.1.css"
|
||||||
#define JS_FILE "swad19.91.1.js"
|
#define JS_FILE "swad19.91.1.js"
|
||||||
/*
|
/*
|
||||||
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
|
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
|
||||||
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
||||||
|
// Version 19.95: Dec 17, 2019 Trying Leaflet (open-source JavaScript library for mobile-friendly interactive maps). (? lines)
|
||||||
|
|
||||||
|
Version 19.94.2: Dec 17, 2019 Code refactoring in centre information. (249178 lines)
|
||||||
Version 19.94.1: Dec 17, 2019 Fixed bug in listing of degrees. (249168 lines)
|
Version 19.94.1: Dec 17, 2019 Fixed bug in listing of degrees. (249168 lines)
|
||||||
Version 19.94: Dec 17, 2019 Code optimization getting time to generate page.
|
Version 19.94: Dec 17, 2019 Code optimization getting time to generate page.
|
||||||
Code optimizations getting data of courses, degrees and centres. (? lines)
|
Code optimizations getting data of courses, degrees and centres. (? lines)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user