Version 15.210.4

This commit is contained in:
Antonio Cañas Vargas 2016-05-05 20:16:28 +02:00
parent 79f45bc052
commit 948f6ca40c
6 changed files with 46 additions and 67 deletions

View File

@ -77,6 +77,7 @@ extern struct Globals Gbl;
static void Ctr_Configuration (bool PrintView);
static void Ctr_PutIconsToPrintAndUpload (void);
static void Ctr_PutIconToChangePhoto (void);
static void Ctr_ListCentres (void);
static void Ctr_PutIconToEditFrames (void);
@ -544,18 +545,12 @@ static void Ctr_Configuration (bool PrintView)
}
/*****************************************************************************/
/************* Put icon to print the configuration of a centre ***************/
/************ Put contextual icons in configuration of a centre **************/
/*****************************************************************************/
static void Ctr_PutIconsToPrintAndUpload (void)
{
extern const char *Txt_Print;
extern const char *Txt_Change_logo;
extern const char *Txt_Upload_logo;
extern const char *Txt_Change_photo;
extern const char *Txt_Upload_photo;
char Path[PATH_MAX+1];
bool Exists;
/***** Link to print info about centre *****/
Lay_PutContextualLink (ActPrnCtrInf,NULL,"print64x64.png",Txt_Print,NULL);
@ -563,32 +558,38 @@ static void Ctr_PutIconsToPrintAndUpload (void)
if (Gbl.Usrs.Me.LoggedRole >= Rol_CTR_ADM)
{
/***** Link to upload logo of centre *****/
sprintf (Path,"%s/%s/%02u/%u/logo/%u.png",
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR,
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
Exists = Fil_CheckIfPathExists (Path);
Lay_PutContextualLink (ActReqCtrLog,NULL,"logo64x64.png",
Exists ? Txt_Change_logo :
Txt_Upload_logo,
NULL);
Log_PutIconToChangeLogo (Sco_SCOPE_CTR);
/***** Link to upload photo of centre *****/
sprintf (Path,"%s/%s/%02u/%u/%u.jpg",
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR,
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
Exists = Fil_CheckIfPathExists (Path);
Lay_PutContextualLink (ActReqCtrPho,NULL,
"photo64x64.gif",
Exists ? Txt_Change_photo :
Txt_Upload_photo,
NULL);
Ctr_PutIconToChangePhoto ();
}
}
/*****************************************************************************/
/************* Put contextual icons to upload photo of centre ****************/
/*****************************************************************************/
static void Ctr_PutIconToChangePhoto (void)
{
extern const char *Txt_Change_photo;
extern const char *Txt_Upload_photo;
char PathPhoto[PATH_MAX+1];
bool PhotoExists;
/***** Link to upload photo of centre *****/
sprintf (PathPhoto,"%s/%s/%02u/%u/%u.jpg",
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR,
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
PhotoExists = Fil_CheckIfPathExists (PathPhoto);
Lay_PutContextualLink (ActReqCtrPho,NULL,
"photo64x64.gif",
PhotoExists ? Txt_Change_photo :
Txt_Upload_photo,
NULL);
}
/*****************************************************************************/
/*************** Show the centres of the current institution *****************/
/*****************************************************************************/

View File

@ -138,13 +138,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.210.3 (2016-05-05)"
#define Log_PLATFORM_VERSION "SWAD 15.210.4 (2016-05-05)"
#define CSS_FILE "swad15.210.css"
#define JS_FILE "swad15.197.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/*
Version 15.210.4: May 05, 2016 Link to change logo of degree is moved to top of window. (201385 lines)
Version 15.210.3: May 05, 2016 Link to change logo of centre is moved to top of window. (201407 lines)
Version 15.210.2: May 05, 2016 Link to change logo of institution is moved to top of window. (201399 lines)
Version 15.210.1: May 05, 2016 New icon to change logo of institution/centre/degree. (201388 lines)

View File

@ -86,7 +86,7 @@ typedef enum
/*****************************************************************************/
static void Deg_Configuration (bool PrintView);
static void Deg_PutIconToPrint (void);
static void Deg_PutIconsToPrintAndUpload (void);
static void Deg_WriteSelectorOfDegree (void);
@ -300,21 +300,9 @@ static void Deg_Configuration (bool PrintView)
if (Gbl.CurrentDeg.Deg.DegCod > 0)
{
/***** Links to show courses, to print view and to upload logo *****/
if (!PrintView &&
Gbl.Usrs.Me.LoggedRole >= Rol_DEG_ADM)
{
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
/* Link to upload logo */
Log_PutFormToChangeLogo (Sco_SCOPE_DEG);
fprintf (Gbl.F.Out,"</div>");
}
/***** Start frame *****/
Lay_StartRoundFrame (NULL,NULL,PrintView ? NULL :
Deg_PutIconToPrint);
Deg_PutIconsToPrintAndUpload);
/***** Title *****/
fprintf (Gbl.F.Out,"<div class=\"TITLE_LOCATION\">");
@ -471,14 +459,19 @@ static void Deg_Configuration (bool PrintView)
}
/*****************************************************************************/
/************* Put icon to print the configuration of a degree ***************/
/************ Put contextual icons in configuration of a degree **************/
/*****************************************************************************/
static void Deg_PutIconToPrint (void)
static void Deg_PutIconsToPrintAndUpload (void)
{
extern const char *Txt_Print;
/***** Link to print info about degree *****/
Lay_PutContextualLink (ActPrnDegInf,NULL,"print64x64.png",Txt_Print,NULL);
if (Gbl.Usrs.Me.LoggedRole >= Rol_DEG_ADM)
/***** Link to upload logo of degree *****/
Log_PutIconToChangeLogo (Sco_SCOPE_DEG);
}
/*****************************************************************************/

View File

@ -488,28 +488,13 @@ static void Ins_Configuration (bool PrintView)
static void Ins_PutIconsToPrintAndUpload (void)
{
extern const char *Txt_Print;
extern const char *Txt_Change_logo;
extern const char *Txt_Upload_logo;
char Path[PATH_MAX+1];
bool Exists;
/***** Link to print info about institution *****/
Lay_PutContextualLink (ActPrnInsInf,NULL,"print64x64.png",Txt_Print,NULL);
if (Gbl.Usrs.Me.LoggedRole >= Rol_INS_ADM)
{
/***** Link to upload logo of institution *****/
sprintf (Path,"%s/%s/%02u/%u/logo/%u.png",
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_INS,
(unsigned) (Gbl.CurrentIns.Ins.InsCod % 100),
(unsigned) Gbl.CurrentIns.Ins.InsCod,
(unsigned) Gbl.CurrentIns.Ins.InsCod);
Exists = Fil_CheckIfPathExists (Path);
Lay_PutContextualLink (ActReqInsLog,NULL,"logo64x64.png",
Exists ? Txt_Change_logo :
Txt_Upload_logo,
NULL);
}
Log_PutIconToChangeLogo (Sco_SCOPE_INS);
}
/*****************************************************************************/

View File

@ -168,11 +168,11 @@ void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText,
}
/*****************************************************************************/
/*************** Put a link to the action used to request *******************/
/*************** the logo of institution, centre or degree *******************/
/************* Put an icon to go to the action used to request ***************/
/************* the logo of institution, centre or degree ***************/
/*****************************************************************************/
void Log_PutFormToChangeLogo (Sco_Scope_t Scope)
void Log_PutIconToChangeLogo (Sco_Scope_t Scope)
{
extern const char *Txt_Change_logo;
extern const char *Txt_Upload_logo;
@ -216,8 +216,7 @@ void Log_PutFormToChangeLogo (Sco_Scope_t Scope)
Lay_PutContextualLink (Action,NULL,"logo64x64.png",
LogoExists ? Txt_Change_logo :
Txt_Upload_logo,
LogoExists ? Txt_Change_logo :
Txt_Upload_logo);
NULL);
}
/*****************************************************************************/

View File

@ -41,7 +41,7 @@
void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText,
unsigned Size,const char *Class,bool PutIconIfNotExists);
void Log_PutFormToChangeLogo (Sco_Scope_t Scope);
void Log_PutIconToChangeLogo (Sco_Scope_t Scope);
void Log_RequestLogo (Sco_Scope_t Scope);
void Log_ReceiveLogo (Sco_Scope_t Scope);
void Log_RemoveLogo (Sco_Scope_t Scope);