Version19.97.11

This commit is contained in:
Antonio Cañas Vargas 2019-12-26 20:12:27 +01:00
parent b79daa5c3e
commit 98e147e1f5
7 changed files with 113 additions and 156 deletions

View File

@ -95,10 +95,10 @@ static void Ctr_ConfigLongitude (void);
static void Ctr_ConfigAltitude (void); static void Ctr_ConfigAltitude (void);
static void Ctr_ConfigPhoto (bool PrintView,bool PutLink); static void Ctr_ConfigPhoto (bool PrintView,bool PutLink);
static void Ctr_ConfigInstitution (bool PrintView); static void Ctr_ConfigInstitution (bool PrintView);
static void Ctr_ConfigFullName (bool PrintView); static void Ctr_ConfigFullName (bool PutForm);
static void Ctr_ConfigShrtName (bool PrintView); static void Ctr_ConfigShrtName (bool PutForm);
static void Ctr_ConfigPlace (bool PrintView); static void Ctr_ConfigPlace (bool PrintView);
static void Ctr_ConfigWWW (bool PrintView); static void Ctr_ConfigWWW (bool PutForm);
static void Ctr_ConfigShortcut (void); static void Ctr_ConfigShortcut (void);
static void Ctr_ConfigQR (void); static void Ctr_ConfigQR (void);
static void Ctr_ConfigNumUsrs (void); static void Ctr_ConfigNumUsrs (void);
@ -313,11 +313,18 @@ static void Ctr_Configuration (bool PrintView)
{ {
extern const char *Hlp_CENTRE_Information; extern const char *Hlp_CENTRE_Information;
bool PutLink; bool PutLink;
bool PutFormName;
bool PutFormWWW;
/***** Trivial check *****/ /***** Trivial check *****/
if (Gbl.Hierarchy.Ctr.CtrCod <= 0) // No centre selected if (Gbl.Hierarchy.Ctr.CtrCod <= 0) // No centre selected
return; return;
/***** Initializations *****/
PutLink = !PrintView && Gbl.Hierarchy.Ctr.WWW[0];
PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM;
PutFormWWW = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM;
/***** Begin box *****/ /***** Begin box *****/
if (PrintView) if (PrintView)
Box_BoxBegin (NULL,NULL,NULL, Box_BoxBegin (NULL,NULL,NULL,
@ -327,7 +334,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];
Ctr_ConfigTitle (PutLink); Ctr_ConfigTitle (PutLink);
/***** Centre map *****/ /***** Centre map *****/
@ -344,8 +350,8 @@ static void Ctr_Configuration (bool PrintView)
Ctr_ConfigInstitution (PrintView); Ctr_ConfigInstitution (PrintView);
/***** Centre name *****/ /***** Centre name *****/
Ctr_ConfigFullName (PrintView); Ctr_ConfigFullName (PutFormName);
Ctr_ConfigShrtName (PrintView); Ctr_ConfigShrtName (PutFormName);
/***** Place *****/ /***** Place *****/
Ctr_ConfigPlace (PrintView); Ctr_ConfigPlace (PrintView);
@ -359,7 +365,7 @@ static void Ctr_Configuration (bool PrintView)
} }
/***** Centre WWW *****/ /***** Centre WWW *****/
Ctr_ConfigWWW (PrintView); Ctr_ConfigWWW (PutFormWWW);
/***** Shortcut to the centre *****/ /***** Shortcut to the centre *****/
Ctr_ConfigShortcut (); Ctr_ConfigShortcut ();
@ -727,7 +733,7 @@ static void Ctr_ConfigInstitution (bool PrintView)
/************** Show centre full name in centre configuration ****************/ /************** Show centre full name in centre configuration ****************/
/*****************************************************************************/ /*****************************************************************************/
static void Ctr_ConfigFullName (bool PrintView) static void Ctr_ConfigFullName (bool PutForm)
{ {
extern const char *Txt_Centre; extern const char *Txt_Centre;
@ -736,9 +742,7 @@ static void Ctr_ConfigFullName (bool PrintView)
Hie_ConfigLabel ("FullName",Txt_Centre); Hie_ConfigLabel ("FullName",Txt_Centre);
HTM_TD_Begin ("class=\"DAT_N LM\""); HTM_TD_Begin ("class=\"DAT_N LM\"");
if (!PrintView && if (PutForm)
Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM)
// Only institution admins and system admins can edit centre full name
{ {
/* Form to change centre full name */ /* Form to change centre full name */
Frm_StartForm (ActRenCtrFulCfg); Frm_StartForm (ActRenCtrFulCfg);
@ -757,7 +761,7 @@ static void Ctr_ConfigFullName (bool PrintView)
/************** Show centre short name in centre configuration ***************/ /************** Show centre short name in centre configuration ***************/
/*****************************************************************************/ /*****************************************************************************/
static void Ctr_ConfigShrtName (bool PrintView) static void Ctr_ConfigShrtName (bool PutForm)
{ {
extern const char *Txt_Short_name; extern const char *Txt_Short_name;
@ -766,9 +770,7 @@ static void Ctr_ConfigShrtName (bool PrintView)
Hie_ConfigLabel ("ShortName",Txt_Short_name); Hie_ConfigLabel ("ShortName",Txt_Short_name);
HTM_TD_Begin ("class=\"DAT_N LM\""); HTM_TD_Begin ("class=\"DAT_N LM\"");
if (!PrintView && if (PutForm)
Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM)
// Only institution admins and system admins can edit centre short name
{ {
/* Form to change centre short name */ /* Form to change centre short name */
Frm_StartForm (ActRenCtrShoCfg); Frm_StartForm (ActRenCtrShoCfg);
@ -840,38 +842,9 @@ static void Ctr_ConfigPlace (bool PrintView)
/***************** Show centre WWW in centre configuration *******************/ /***************** Show centre WWW in centre configuration *******************/
/*****************************************************************************/ /*****************************************************************************/
static void Ctr_ConfigWWW (bool PrintView) static void Ctr_ConfigWWW (bool PutForm)
{ {
extern const char *Txt_Web; Hie_ConfigWWW (PutForm,ActChgCtrWWWCfg,Gbl.Hierarchy.Ctr.WWW);
HTM_TR_Begin (NULL);
Hie_ConfigLabel ("WWW",Txt_Web);
HTM_TD_Begin ("class=\"LM\"");
if (!PrintView &&
Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM)
// Only centre admins, institution admins and system admins
// can change centre WWW
{
/* Form to change centre WWW */
Frm_StartForm (ActChgCtrWWWCfg);
HTM_INPUT_URL ("WWW",Gbl.Hierarchy.Ctr.WWW,true,
"id=\"WWW\" class=\"INPUT_WWW_WIDE\" required=\"required\"");
Frm_EndForm ();
}
else // I can not change centre WWW
{
HTM_DIV_Begin ("class=\"EXTERNAL_WWW_LONG\"");
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"DAT\"",
Gbl.Hierarchy.Ctr.WWW);
HTM_Txt (Gbl.Hierarchy.Ctr.WWW);
HTM_A_End ();
HTM_DIV_End ();
}
HTM_TD_End ();
HTM_TR_End ();
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -492,7 +492,7 @@ 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.97.10 (2019-12-26)" #define Log_PLATFORM_VERSION "SWAD 19.97.11 (2019-12-26)"
#define CSS_FILE "swad19.97.css" #define CSS_FILE "swad19.97.css"
#define JS_FILE "swad19.91.1.js" #define JS_FILE "swad19.91.1.js"
/* /*
@ -500,7 +500,10 @@ ps2pdf source.ps destination.pdf
// 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.
// TODO: No se puede entrar con DNI '1' suponiendo que no tenga password ¿por qué? // TODO: No se puede entrar con DNI '1' suponiendo que no tenga password ¿por qué?
Version 19.99: Dec 26, 2019 Map in country information. (? lines)
Version 19.98: Dec 26, 2019 Map in institution information. (? lines) Version 19.98: Dec 26, 2019 Map in institution information. (? lines)
Version 19.97.12: Dec 26, 2019 Code refactoring in country information. (? lines)
Version 19.97.11: Dec 26, 2019 Code refactoring in degree, centre and institution information. (249353 lines)
Version 19.97.10: Dec 26, 2019 Code refactoring in course, degree, centre and institution information. (249394 lines) Version 19.97.10: Dec 26, 2019 Code refactoring in course, degree, centre and institution information. (249394 lines)
Version 19.97.9: Dec 26, 2019 Code refactoring in course information. (249557 lines) Version 19.97.9: Dec 26, 2019 Code refactoring in course information. (249557 lines)
Version 19.97.8: Dec 26, 2019 Code refactoring in degree information. (249458 lines) Version 19.97.8: Dec 26, 2019 Code refactoring in degree information. (249458 lines)

View File

@ -83,8 +83,8 @@ static void Crs_Configuration (bool PrintView);
static void Crs_PutIconToPrint (void); static void Crs_PutIconToPrint (void);
static void Crs_ConfigTitle (bool PutLink); static void Crs_ConfigTitle (bool PutLink);
static void Crs_ConfigDegree (bool PrintView); static void Crs_ConfigDegree (bool PrintView);
static void Crs_ConfigFullName (bool PrintView); static void Crs_ConfigFullName (bool PutForm);
static void Crs_ConfigShrtName (bool PrintView); static void Crs_ConfigShrtName (bool PutForm);
static void Crs_ConfigYear (bool IsForm); static void Crs_ConfigYear (bool IsForm);
static void Crs_ConfigInstitutionalCode (bool IsForm); static void Crs_ConfigInstitutionalCode (bool IsForm);
static void Crs_ConfigInternalCode (void); static void Crs_ConfigInternalCode (void);
@ -183,12 +183,17 @@ static void Crs_Configuration (bool PrintView)
{ {
extern const char *Hlp_COURSE_Information; extern const char *Hlp_COURSE_Information;
bool PutLink; bool PutLink;
bool PutFormName;
bool IsForm; bool IsForm;
/***** Trivial check *****/ /***** Trivial check *****/
if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected
return; return;
/***** Initializations *****/
PutLink = !PrintView && Gbl.Hierarchy.Deg.WWW[0];
PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM;
/***** Contextual menu *****/ /***** Contextual menu *****/
if (!PrintView) if (!PrintView)
if (Gbl.Usrs.Me.Role.Logged == Rol_GST || if (Gbl.Usrs.Me.Role.Logged == Rol_GST ||
@ -208,7 +213,6 @@ static void Crs_Configuration (bool PrintView)
Hlp_COURSE_Information,Box_NOT_CLOSABLE); Hlp_COURSE_Information,Box_NOT_CLOSABLE);
/***** Title *****/ /***** Title *****/
PutLink = !PrintView && Gbl.Hierarchy.Deg.WWW[0];
Crs_ConfigTitle (PutLink); Crs_ConfigTitle (PutLink);
/***** Begin table *****/ /***** Begin table *****/
@ -218,8 +222,8 @@ static void Crs_Configuration (bool PrintView)
Crs_ConfigDegree (PrintView); Crs_ConfigDegree (PrintView);
/***** Course name *****/ /***** Course name *****/
Crs_ConfigFullName (PrintView); Crs_ConfigFullName (PutFormName);
Crs_ConfigShrtName (PrintView); Crs_ConfigShrtName (PutFormName);
/***** Course year *****/ /***** Course year *****/
IsForm = (!PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_TCH); IsForm = (!PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_TCH);
@ -334,7 +338,7 @@ static void Crs_ConfigDegree (bool PrintView)
/************** Show course full name in course configuration ****************/ /************** Show course full name in course configuration ****************/
/*****************************************************************************/ /*****************************************************************************/
static void Crs_ConfigFullName (bool PrintView) static void Crs_ConfigFullName (bool PutForm)
{ {
extern const char *Txt_Course; extern const char *Txt_Course;
@ -343,10 +347,7 @@ static void Crs_ConfigFullName (bool PrintView)
Hie_ConfigLabel ("FullName",Txt_Course); Hie_ConfigLabel ("FullName",Txt_Course);
HTM_TD_Begin ("class=\"DAT_N LM\""); HTM_TD_Begin ("class=\"DAT_N LM\"");
if (!PrintView && if (PutForm)
Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM)
// Only degree admins, centre admins, institution admins and system admins
// can edit course full name
{ {
/* Form to change course full name */ /* Form to change course full name */
Frm_StartForm (ActRenCrsFulCfg); Frm_StartForm (ActRenCrsFulCfg);
@ -365,7 +366,7 @@ static void Crs_ConfigFullName (bool PrintView)
/************** Show course short name in course configuration ***************/ /************** Show course short name in course configuration ***************/
/*****************************************************************************/ /*****************************************************************************/
static void Crs_ConfigShrtName (bool PrintView) static void Crs_ConfigShrtName (bool PutForm)
{ {
extern const char *Txt_Short_name; extern const char *Txt_Short_name;
@ -375,10 +376,7 @@ static void Crs_ConfigShrtName (bool PrintView)
Hie_ConfigLabel ("ShortName",Txt_Short_name); Hie_ConfigLabel ("ShortName",Txt_Short_name);
HTM_TD_Begin ("class=\"DAT_N LM\""); HTM_TD_Begin ("class=\"DAT_N LM\"");
if (!PrintView && if (PutForm)
Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM)
// Only degree admins, centre admins, institution admins and system admins
// can edit course short name
{ {
/* Form to change course short name */ /* Form to change course short name */
Frm_StartForm (ActRenCrsShoCfg); Frm_StartForm (ActRenCrsShoCfg);

View File

@ -91,9 +91,9 @@ static void Deg_Configuration (bool PrintView);
static void Deg_PutIconsToPrintAndUpload (void); static void Deg_PutIconsToPrintAndUpload (void);
static void Deg_ConfigTitle (bool PutLink); static void Deg_ConfigTitle (bool PutLink);
static void Deg_ConfigCentre (bool PrintView); static void Deg_ConfigCentre (bool PrintView);
static void Deg_ConfigFullName (bool PrintView); static void Deg_ConfigFullName (bool PutForm);
static void Deg_ConfigShrtName (bool PrintView); static void Deg_ConfigShrtName (bool PutForm);
static void Deg_ConfigWWW (bool PrintView); static void Deg_ConfigWWW (bool PutForm);
static void Deg_ConfigShortcut (void); static void Deg_ConfigShortcut (void);
static void Deg_ConfigQR (void); static void Deg_ConfigQR (void);
static void Deg_ConfigNumCrss (void); static void Deg_ConfigNumCrss (void);
@ -303,11 +303,18 @@ static void Deg_Configuration (bool PrintView)
{ {
extern const char *Hlp_DEGREE_Information; extern const char *Hlp_DEGREE_Information;
bool PutLink; bool PutLink;
bool PutFormName;
bool PutFormWWW;
/***** Trivial check *****/ /***** Trivial check *****/
if (Gbl.Hierarchy.Deg.DegCod <= 0) // No degree selected if (Gbl.Hierarchy.Deg.DegCod <= 0) // No degree selected
return; return;
/***** Initializations *****/
PutLink = !PrintView && Gbl.Hierarchy.Deg.WWW[0];
PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM;
PutFormWWW = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM;
/***** Begin box *****/ /***** Begin box *****/
if (PrintView) if (PrintView)
Box_BoxBegin (NULL,NULL,NULL, Box_BoxBegin (NULL,NULL,NULL,
@ -317,7 +324,6 @@ static void Deg_Configuration (bool PrintView)
Hlp_DEGREE_Information,Box_NOT_CLOSABLE); Hlp_DEGREE_Information,Box_NOT_CLOSABLE);
/***** Title *****/ /***** Title *****/
PutLink = !PrintView && Gbl.Hierarchy.Deg.WWW[0];
Deg_ConfigTitle (PutLink); Deg_ConfigTitle (PutLink);
/***** Begin table *****/ /***** Begin table *****/
@ -327,11 +333,11 @@ static void Deg_Configuration (bool PrintView)
Deg_ConfigCentre (PrintView); Deg_ConfigCentre (PrintView);
/***** Degree name *****/ /***** Degree name *****/
Deg_ConfigFullName (PrintView); Deg_ConfigFullName (PutFormName);
Deg_ConfigShrtName (PrintView); Deg_ConfigShrtName (PutFormName);
/***** Degree WWW *****/ /***** Degree WWW *****/
Deg_ConfigWWW (PrintView); Deg_ConfigWWW (PutFormWWW);
/***** Shortcut to the degree *****/ /***** Shortcut to the degree *****/
Deg_ConfigShortcut (); Deg_ConfigShortcut ();
@ -439,7 +445,7 @@ static void Deg_ConfigCentre (bool PrintView)
/************** Show degree full name in degree configuration ****************/ /************** Show degree full name in degree configuration ****************/
/*****************************************************************************/ /*****************************************************************************/
static void Deg_ConfigFullName (bool PrintView) static void Deg_ConfigFullName (bool PutForm)
{ {
extern const char *Txt_Degree; extern const char *Txt_Degree;
@ -448,10 +454,7 @@ static void Deg_ConfigFullName (bool PrintView)
Hie_ConfigLabel ("FullName",Txt_Degree); Hie_ConfigLabel ("FullName",Txt_Degree);
HTM_TD_Begin ("class=\"DAT_N LM\""); HTM_TD_Begin ("class=\"DAT_N LM\"");
if (!PrintView && if (PutForm)
Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM)
// Only centre admins, institution admins and system admins
// can edit degree full name
{ {
/* Form to change degree full name */ /* Form to change degree full name */
Frm_StartForm (ActRenDegFulCfg); Frm_StartForm (ActRenDegFulCfg);
@ -470,7 +473,7 @@ static void Deg_ConfigFullName (bool PrintView)
/************** Show degree short name in degree configuration ***************/ /************** Show degree short name in degree configuration ***************/
/*****************************************************************************/ /*****************************************************************************/
static void Deg_ConfigShrtName (bool PrintView) static void Deg_ConfigShrtName (bool PutForm)
{ {
extern const char *Txt_Short_name; extern const char *Txt_Short_name;
@ -479,10 +482,7 @@ static void Deg_ConfigShrtName (bool PrintView)
Hie_ConfigLabel ("ShortName",Txt_Short_name); Hie_ConfigLabel ("ShortName",Txt_Short_name);
HTM_TD_Begin ("class=\"DAT_N LM\""); HTM_TD_Begin ("class=\"DAT_N LM\"");
if (!PrintView && if (PutForm)
Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM)
// Only centre admins, institution admins and system admins
// can edit degree short name
{ {
/* Form to change degree short name */ /* Form to change degree short name */
Frm_StartForm (ActRenDegShoCfg); Frm_StartForm (ActRenDegShoCfg);
@ -501,38 +501,9 @@ static void Deg_ConfigShrtName (bool PrintView)
/***************** Show degree WWW in degree configuration *******************/ /***************** Show degree WWW in degree configuration *******************/
/*****************************************************************************/ /*****************************************************************************/
static void Deg_ConfigWWW (bool PrintView) static void Deg_ConfigWWW (bool PutForm)
{ {
extern const char *Txt_Web; Hie_ConfigWWW (PutForm,ActChgDegWWWCfg,Gbl.Hierarchy.Deg.WWW);
HTM_TR_Begin (NULL);
Hie_ConfigLabel ("WWW",Txt_Web);
HTM_TD_Begin ("class=\"DAT LM\"");
if (!PrintView &&
Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM)
// Only degree admins, centre admins, institution admins
// and system admins can change degree WWW
{
/* Form to change degree WWW */
Frm_StartForm (ActChgDegWWWCfg);
HTM_INPUT_URL ("WWW",Gbl.Hierarchy.Deg.WWW,true,
"id=\"WWW\" class=\"INPUT_WWW_WIDE\" required=\"required\"");
Frm_EndForm ();
}
else // I can not change degree WWW
{
HTM_DIV_Begin ("class=\"EXTERNAL_WWW_LONG\"");
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"DAT\"",
Gbl.Hierarchy.Deg.WWW);
HTM_Txt (Gbl.Hierarchy.Deg.WWW);
HTM_A_End ();
HTM_DIV_End ();
}
HTM_TD_End ();
HTM_TR_End ();
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -105,6 +105,43 @@ void Hie_ConfigLabel (const char *Id,const char *Label)
HTM_TD_End (); HTM_TD_End ();
} }
/*****************************************************************************/
/************************* Show web in configuration *************************/
/*****************************************************************************/
void Hie_ConfigWWW (bool PutForm,Act_Action_t NextAction,
const char WWW[Cns_MAX_BYTES_WWW + 1])
{
extern const char *Txt_Web;
HTM_TR_Begin (NULL);
Hie_ConfigLabel (PutForm ? "WWW" :
NULL,
Txt_Web);
HTM_TD_Begin ("class=\"DAT LM\"");
if (PutForm)
{
/* Form to change web */
Frm_StartForm (NextAction);
HTM_INPUT_URL ("WWW",WWW,true,
"id=\"WWW\" class=\"INPUT_WWW_WIDE\" required=\"required\"");
Frm_EndForm ();
}
else // I can not change web
{
HTM_DIV_Begin ("class=\"EXTERNAL_WWW_LONG\"");
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"DAT\"",WWW);
HTM_Txt (WWW);
HTM_A_End ();
HTM_DIV_End ();
}
HTM_TD_End ();
HTM_TR_End ();
}
/*****************************************************************************/ /*****************************************************************************/
/********** List pending institutions, centres, degrees and courses **********/ /********** List pending institutions, centres, degrees and courses **********/
/*****************************************************************************/ /*****************************************************************************/

View File

@ -66,6 +66,8 @@ void Hie_ConfigTitle (bool PutLink,
char LogoWWW[Cns_MAX_BYTES_WWW + 1], char LogoWWW[Cns_MAX_BYTES_WWW + 1],
char TextFullName[Hie_MAX_BYTES_FULL_NAME + 1]); char TextFullName[Hie_MAX_BYTES_FULL_NAME + 1]);
void Hie_ConfigLabel (const char *Id,const char *Label); void Hie_ConfigLabel (const char *Id,const char *Label);
void Hie_ConfigWWW (bool PutForm,Act_Action_t NextAction,
const char WWW[Cns_MAX_BYTES_WWW + 1]);
void Hie_SeePending (void); void Hie_SeePending (void);

View File

@ -75,9 +75,9 @@ static void Ins_ConfigTitle (bool PutLink);
static bool Ins_GetIfMapIsAvailable (void); static bool Ins_GetIfMapIsAvailable (void);
static void Ins_ConfigMap (void); static void Ins_ConfigMap (void);
static void Ins_ConfigCountry (bool PrintView); static void Ins_ConfigCountry (bool PrintView);
static void Ins_ConfigFullName (bool PrintView); static void Ins_ConfigFullName (bool PutForm);
static void Ins_ConfigShrtName (bool PrintView); static void Ins_ConfigShrtName (bool PutForm);
static void Ins_ConfigWWW (bool PrintView); static void Ins_ConfigWWW (bool PutForm);
static void Ins_ConfigShortcut (void); static void Ins_ConfigShortcut (void);
static void Ins_ConfigQR (void); static void Ins_ConfigQR (void);
static void Ins_ConfigNumUsrs (void); static void Ins_ConfigNumUsrs (void);
@ -319,11 +319,18 @@ static void Ins_Configuration (bool PrintView)
{ {
extern const char *Hlp_INSTITUTION_Information; extern const char *Hlp_INSTITUTION_Information;
bool PutLink; bool PutLink;
bool PutFormName;
bool PutFormWWW;
/***** Trivial check *****/ /***** Trivial check *****/
if (Gbl.Hierarchy.Ins.InsCod <= 0) // No institution selected if (Gbl.Hierarchy.Ins.InsCod <= 0) // No institution selected
return; return;
/***** Initializations *****/
PutLink = !PrintView && Gbl.Hierarchy.Ins.WWW[0];
PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
PutFormWWW = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM;
/***** Begin box *****/ /***** Begin box *****/
if (PrintView) if (PrintView)
Box_BoxBegin (NULL,NULL,NULL, Box_BoxBegin (NULL,NULL,NULL,
@ -334,7 +341,6 @@ static void Ins_Configuration (bool PrintView)
/***** Title *****/ /***** Title *****/
PutLink = !PrintView && Gbl.Hierarchy.Ins.WWW[0];
Ins_ConfigTitle (PutLink); Ins_ConfigTitle (PutLink);
/***** Institution map *****/ /***** Institution map *****/
@ -348,11 +354,11 @@ static void Ins_Configuration (bool PrintView)
Ins_ConfigCountry (PrintView); Ins_ConfigCountry (PrintView);
/***** Institution name *****/ /***** Institution name *****/
Ins_ConfigFullName (PrintView); Ins_ConfigFullName (PutFormName);
Ins_ConfigShrtName (PrintView); Ins_ConfigShrtName (PutFormName);
/***** Institution WWW *****/ /***** Institution WWW *****/
Ins_ConfigWWW (PrintView); Ins_ConfigWWW (PutFormWWW);
/***** Shortcut to the institution *****/ /***** Shortcut to the institution *****/
Ins_ConfigShortcut (); Ins_ConfigShortcut ();
@ -545,7 +551,7 @@ static void Ins_ConfigCountry (bool PrintView)
/********* Show institution full name in institution configuration ***********/ /********* Show institution full name in institution configuration ***********/
/*****************************************************************************/ /*****************************************************************************/
static void Ins_ConfigFullName (bool PrintView) static void Ins_ConfigFullName (bool PutForm)
{ {
extern const char *Txt_Institution; extern const char *Txt_Institution;
@ -554,9 +560,7 @@ static void Ins_ConfigFullName (bool PrintView)
Hie_ConfigLabel ("FullName",Txt_Institution); Hie_ConfigLabel ("FullName",Txt_Institution);
HTM_TD_Begin ("class=\"DAT_N LM\""); HTM_TD_Begin ("class=\"DAT_N LM\"");
if (!PrintView && if (PutForm)
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
// Only system admins can edit institution full name
{ {
/* Form to change institution full name */ /* Form to change institution full name */
Frm_StartForm (ActRenInsFulCfg); Frm_StartForm (ActRenInsFulCfg);
@ -575,7 +579,7 @@ static void Ins_ConfigFullName (bool PrintView)
/********* Show institution short name in institution configuration **********/ /********* Show institution short name in institution configuration **********/
/*****************************************************************************/ /*****************************************************************************/
static void Ins_ConfigShrtName (bool PrintView) static void Ins_ConfigShrtName (bool PutForm)
{ {
extern const char *Txt_Short_name; extern const char *Txt_Short_name;
@ -584,9 +588,7 @@ static void Ins_ConfigShrtName (bool PrintView)
Hie_ConfigLabel ("ShortName",Txt_Short_name); Hie_ConfigLabel ("ShortName",Txt_Short_name);
HTM_TD_Begin ("class=\"DAT_N LM\""); HTM_TD_Begin ("class=\"DAT_N LM\"");
if (!PrintView && if (PutForm)
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
// Only system admins can edit institution short name
{ {
/* Form to change institution short name */ /* Form to change institution short name */
Frm_StartForm (ActRenInsShoCfg); Frm_StartForm (ActRenInsShoCfg);
@ -605,38 +607,9 @@ static void Ins_ConfigShrtName (bool PrintView)
/************ Show institution WWW in institution configuration **************/ /************ Show institution WWW in institution configuration **************/
/*****************************************************************************/ /*****************************************************************************/
static void Ins_ConfigWWW (bool PrintView) static void Ins_ConfigWWW (bool PutForm)
{ {
extern const char *Txt_Web; Hie_ConfigWWW (PutForm,ActChgInsWWWCfg,Gbl.Hierarchy.Ins.WWW);
HTM_TR_Begin (NULL);
Hie_ConfigLabel ("WWW",Txt_Web);
HTM_TD_Begin ("class=\"DAT LM\"");
if (!PrintView &&
Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM)
// Only institution admins and system admins
// can change institution WWW
{
/* Form to change institution WWW */
Frm_StartForm (ActChgInsWWWCfg);
HTM_INPUT_URL ("WWW",Gbl.Hierarchy.Ins.WWW,true,
"id=\"WWW\" class=\"INPUT_WWW_WIDE\" required=\"required\"");
Frm_EndForm ();
}
else // I can not change institution WWW
{
HTM_DIV_Begin ("class=\"EXTERNAL_WWW_LONG\"");
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"DAT\"",
Gbl.Hierarchy.Ins.WWW);
HTM_Txt (Gbl.Hierarchy.Ins.WWW);
HTM_A_End ();
HTM_DIV_End ();
}
HTM_TD_End ();
HTM_TR_End ();
} }
/*****************************************************************************/ /*****************************************************************************/