Version 23.45: Nov 07, 2023 Improvements in responsive design.

This commit is contained in:
acanas 2023-11-07 11:01:14 +01:00
parent fd67813920
commit 61d93d612f
27 changed files with 228 additions and 140 deletions

View File

@ -749,11 +749,17 @@ a:hover /* Default ==> underlined */
vertical-align:top; vertical-align:top;
overflow:hidden; overflow:hidden;
} }
.TAB_ICO
{
height:28px;
vertical-align:middle;
padding:4px 0;
}
.TAB_TXT .TAB_TXT
{ {
font-size:9pt; font-size:9pt;
font-weight:bold; font-weight:bold;
max-width:30px; max-width:26px;
white-space:nowrap; white-space:nowrap;
overflow:hidden; overflow:hidden;
padding-top:2px; padding-top:2px;
@ -797,6 +803,12 @@ a:hover /* Default ==> underlined */
vertical-align:top; vertical-align:top;
overflow:hidden; overflow:hidden;
} }
.TAB_ICO
{
height:28px;
vertical-align:middle;
padding:4px 0;
}
.TAB_TXT .TAB_TXT
{ {
font-size:9pt; font-size:9pt;
@ -845,6 +857,12 @@ a:hover /* Default ==> underlined */
vertical-align:top; vertical-align:top;
overflow:hidden; overflow:hidden;
} }
.TAB_ICO
{
height:28px;
vertical-align:middle;
padding:4px 0;
}
.TAB_TXT .TAB_TXT
{ {
font-size:9pt; font-size:9pt;
@ -889,12 +907,6 @@ a:hover /* Default ==> underlined */
.TAB_ON_TXT_PINK {color:#63474e;} .TAB_ON_TXT_PINK {color:#63474e;}
.TAB_ON_TXT_DARK {color:#e0e0e0;} .TAB_ON_TXT_DARK {color:#e0e0e0;}
.TAB_ICO
{
height:28px;
vertical-align:middle;
padding:4px 0;
}
/* Creating filter from RGB: https://codepen.io/sosuke/pen/Pjoqqp */ /* Creating filter from RGB: https://codepen.io/sosuke/pen/Pjoqqp */
.TAB_ICO_WHITE, .TAB_ICO_WHITE,
.TAB_ICO_GREY, .TAB_ICO_GREY,
@ -1226,7 +1238,7 @@ a:hover /* Default ==> underlined */
line-height:110%; line-height:110%;
white-space:nowrap; white-space:nowrap;
overflow:hidden; overflow:hidden;
width:30px; width:26px;
margin:0 auto; margin:0 auto;
padding:2px 0; padding:2px 0;
} }
@ -1677,7 +1689,7 @@ a:hover img.CENTER_PHOTO_SHOW
.BT_SUBMIT_INLINE .BT_SUBMIT_INLINE
{ {
box-sizing:border-box; box-sizing:border-box;
min-width:170px; width:120px;
margin:0 10px; margin:0 10px;
padding:2px 4px; padding:2px 4px;
border-radius:2px; border-radius:2px;
@ -1690,6 +1702,8 @@ a:hover img.CENTER_PHOTO_SHOW
line-height:normal; line-height:normal;
white-space:nowrap; white-space:nowrap;
vertical-align:middle; vertical-align:middle;
overflow:hidden;
text-overflow:ellipsis;
} }
.BT_SUBMIT:hover .BT_SUBMIT:hover
{ {
@ -1874,7 +1888,7 @@ a:hover img.CENTER_PHOTO_SHOW
overflow:hidden; overflow:hidden;
} }
.NOTICE_BOX_NARROW {width:148px;} .NOTICE_BOX_NARROW {width:148px;}
.NOTICE_BOX_WIDE {width:500px;} .NOTICE_BOX_WIDE {max-width:500px;}
.NOTICE_DATE .NOTICE_DATE
{ {
float:right; float:right;
@ -3992,7 +4006,7 @@ legend {font-size:12pt;}
} }
.PREF_OFF .PREF_OFF
{ {
display:table-cell; display:inline-block;
box-sizing:border-box; box-sizing:border-box;
padding:6px; padding:6px;
text-align:center; text-align:center;
@ -4002,7 +4016,7 @@ legend {font-size:12pt;}
} }
.PREF_ON .PREF_ON
{ {
display:table-cell; display:inline-block;
box-sizing:border-box; box-sizing:border-box;
padding:6px; padding:6px;
text-align:center; text-align:center;
@ -4247,29 +4261,29 @@ legend {font-size:12pt;}
@media only screen and (max-width: 590px) @media only screen and (max-width: 590px)
{ /* For mobile-phones (maximum width visible on Moto G4 vertical) */ { /* For mobile-phones (maximum width visible on Moto G4 vertical) */
.Tml_WIDTH {width:316px;} /* 556-240 */ .Tml_WIDTH {width:276px;} /* 556-280 */
.Tml_RIGHT_WIDTH {width:260px;} /* 500-240 */ .Tml_RIGHT_WIDTH {width:220px;} /* 500-280 */
.Tml_RIGHT_AUTHOR_WIDTH {width:100px;} /* 340-240 */ .Tml_RIGHT_AUTHOR_WIDTH {width: 60px;} /* 340-280 */
.Tml_COM_WIDTH {width:220px;} /* 460-240 */ .Tml_COM_WIDTH {width:180px;} /* 460-280 */
.Tml_COM_AUTHOR_WIDTH {width: 60px;} /* 300-240 */ .Tml_COM_AUTHOR_WIDTH {width: 20px;} /* 300-280 */
.Tml_MED_INPUT_WIDTH {width:160px;} /* 400-240 */ .Tml_MED_INPUT_WIDTH {width:120px;} /* 400-280 */
.TmlNot_FOOT_WIDTH {width:260px;} /* 500-240 */ .TmlNot_FOOT_WIDTH {width:220px;} /* 500-280 */
.Tml_COMM_FOOT_WIDTH {width:220px;} /* 460-240 */ .Tml_COMM_FOOT_WIDTH {width:180px;} /* 460-280 */
.Tml_FAV_NOT_WIDTH {width:120px;} /* (480-240)/2 */ .Tml_FAV_NOT_WIDTH {width:100px;} /* (480-280)/2 */
.Tml_SHA_NOT_WIDTH {width:120px;} /* (480-240)/2 */ .Tml_SHA_NOT_WIDTH {width:100px;} /* (480-280)/2 */
.Tml_FAV_COM_WIDTH {width:200px;} /* 440-240 */ .Tml_FAV_COM_WIDTH {width:160px;} /* 440-280 */
} }
@media only screen and (min-width: 590px) @media only screen and (min-width: 590px)
{ /* For tablets and desktop (maximum width visible on Moto G4 horizontal) */ { /* For tablets and desktop (maximum width visible on Moto G4 horizontal) */
.Tml_WIDTH {width:556px;} .Tml_WIDTH {width:556px;}
.Tml_RIGHT_WIDTH {width:500px;} .Tml_RIGHT_WIDTH {width:500px;}
.Tml_RIGHT_AUTHOR_WIDTH {width:340px;} .Tml_RIGHT_AUTHOR_WIDTH {width:340px;}
.Tml_COM_WIDTH {width:460px;} .Tml_COM_WIDTH {width:460px;}
.Tml_COM_AUTHOR_WIDTH {width:300px;} .Tml_COM_AUTHOR_WIDTH {width:300px;}
.Tml_MED_INPUT_WIDTH {width:400px;} .Tml_MED_INPUT_WIDTH {width:400px;}
.Tml_FAV_NOT_WIDTH {width:240px;} .Tml_FAV_NOT_WIDTH {width:240px;}
.Tml_SHA_NOT_WIDTH {width:240px;} .Tml_SHA_NOT_WIDTH {width:240px;}
.Tml_FAV_COM_WIDTH {width:440px;} .Tml_FAV_COM_WIDTH {width:440px;}
} }
.Tml_NEW_PUB_WHITE, .Tml_NEW_PUB_WHITE,
@ -4945,12 +4959,12 @@ button.PAG_DARK:hover, .PAG_CUR_DARK {background-color:#707070;}
.INPUT_INS_CODE .INPUT_INS_CODE
{ {
box-sizing:border-box; box-sizing:border-box;
width:180px; width:160px;
} }
.INPUT_SHRT_NAME .INPUT_SHRT_NAME
{ {
box-sizing:border-box; box-sizing:border-box;
width:180px; width:160px;
} }
.INPUT_FULL_NAME .INPUT_FULL_NAME
{ {
@ -5010,6 +5024,28 @@ button.PAG_DARK:hover, .PAG_CUR_DARK {background-color:#707070;}
.LC_DEG {text-align:left; vertical-align:top; min-width:150px; max-width:150px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;} .LC_DEG {text-align:left; vertical-align:top; min-width:150px; max-width:150px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.LC_ACT {text-align:left; vertical-align:top; min-width:200px; max-width:200px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;} .LC_ACT {text-align:left; vertical-align:top; min-width:200px; max-width:200px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
/*********************** Listing my courses as a tree ************************/
@media only screen and (max-width: 800px)
{ /* For mobile-phones */
.MY_CRS_TXT
{
display:inline-block;
text-align:left;
vertical-align:middle;
max-width:120px;
overflow:hidden;
}
}
@media only screen and (min-width: 800px)
{ /* For tablets and desktop */
.MY_CRS_TXT
{
display:inline-block;
text-align:left;
vertical-align:middle;
}
}
/********************************** Privacy **********************************/ /********************************** Privacy **********************************/
.PRI_LIST .PRI_LIST
{ {

View File

@ -936,7 +936,7 @@ int swad__loginBySessionKey (struct soap *soap,
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
/***** Get degree of current course *****/ /***** Get degree of current course *****/
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod (); Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetDegCodOfCourseByCod (Gbl.Hierarchy.Node[Hie_CRS].HieCod);
if (UsrFound) if (UsrFound)
{ {
@ -1594,7 +1594,7 @@ int swad__getUsers (struct soap *soap,
"Requester must belong to course"); "Requester must belong to course");
/***** Get degree of current course *****/ /***** Get degree of current course *****/
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod (); Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetDegCodOfCourseByCod (Gbl.Hierarchy.Node[Hie_CRS].HieCod);
/***** Check requested users' role *****/ /***** Check requested users' role *****/
if (userRole != API_ROLE_STUDENT && // Students if (userRole != API_ROLE_STUDENT && // Students
@ -1678,7 +1678,7 @@ int swad__findUsers (struct soap *soap,
if (Gbl.Hierarchy.Level == Hie_CRS) if (Gbl.Hierarchy.Level == Hie_CRS)
/***** Get degree of current course *****/ /***** Get degree of current course *****/
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod (); Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetDegCodOfCourseByCod (Gbl.Hierarchy.Node[Hie_CRS].HieCod);
/***** Check requested users' role *****/ /***** Check requested users' role *****/
if (userRole < API_ROLE_UNKNOWN || if (userRole < API_ROLE_UNKNOWN ||
@ -3360,7 +3360,7 @@ int swad__sendNotice (struct soap *soap,
return ReturnCode; return ReturnCode;
/***** Get degree of current course *****/ /***** Get degree of current course *****/
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod (); Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetDegCodOfCourseByCod (Gbl.Hierarchy.Node[Hie_CRS].HieCod);
/***** Check if I am a teacher *****/ /***** Check if I am a teacher *****/
if (Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs != Rol_TCH) if (Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs != Rol_TCH)
@ -3430,7 +3430,7 @@ int swad__getTestConfig (struct soap *soap,
"Requester must belong to course"); "Requester must belong to course");
/***** Get degree of current course *****/ /***** Get degree of current course *****/
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod (); Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetDegCodOfCourseByCod (Gbl.Hierarchy.Node[Hie_CRS].HieCod);
/***** Set default result to empty *****/ /***** Set default result to empty *****/
getTestConfigOut->numQuestions = getTestConfigOut->numQuestions =
@ -3524,7 +3524,7 @@ int swad__getTests (struct soap *soap,
"Requester must belong to course"); "Requester must belong to course");
/***** Get degree of current course *****/ /***** Get degree of current course *****/
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod (); Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetDegCodOfCourseByCod (Gbl.Hierarchy.Node[Hie_CRS].HieCod);
/***** Set default result to empty *****/ /***** Set default result to empty *****/
getTestsOut->tagsArray.__size = 0; getTestsOut->tagsArray.__size = 0;

View File

@ -1342,7 +1342,7 @@ void HTM_INPUT_PASSWORD (const char *Name,const char *PlaceHolder,
int NumBytesPrinted; int NumBytesPrinted;
char *Attr; char *Attr;
HTM_TxtF ("<input type=\"password\" name=\"%s\" size=\"18\" maxlength=\"%u\"", HTM_TxtF ("<input type=\"password\" name=\"%s\" size=\"16\" maxlength=\"%u\"",
Name,Pwd_MAX_CHARS_PLAIN_PASSWORD); Name,Pwd_MAX_CHARS_PLAIN_PASSWORD);
if (PlaceHolder) if (PlaceHolder)
if (PlaceHolder[0]) if (PlaceHolder[0])

View File

@ -643,7 +643,7 @@ static void ID_ShowFormChangeUsrID (Usr_MeOrOther_t MeOrOther,bool IShouldFillIn
UsrDat[MeOrOther]->IDs.Num ? UsrDat[MeOrOther]->IDs.List[UsrDat[MeOrOther]->IDs.Num - 1].ID : UsrDat[MeOrOther]->IDs.Num ? UsrDat[MeOrOther]->IDs.List[UsrDat[MeOrOther]->IDs.Num - 1].ID :
"", // Show the most recent ID "", // Show the most recent ID
HTM_DONT_SUBMIT_ON_CHANGE, HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"NewID\" class=\"INPUT_%s\" size=\"18\"", "id=\"NewID\" class=\"INPUT_%s\" size=\"16\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_BR (); HTM_BR ();
Btn_PutCreateButtonInline (Txt_Add_this_ID); Btn_PutCreateButtonInline (Txt_Add_this_ID);

View File

@ -168,7 +168,7 @@ static void Acc_ShowFormCheckIfIHaveAccount (const char *Title)
HTM_TxtColonNBSP (Txt_ID); HTM_TxtColonNBSP (Txt_ID);
HTM_INPUT_TEXT ("ID",ID_MAX_CHARS_USR_ID,"", HTM_INPUT_TEXT ("ID",ID_MAX_CHARS_USR_ID,"",
HTM_DONT_SUBMIT_ON_CHANGE, HTM_DONT_SUBMIT_ON_CHANGE,
"size=\"18\" class=\"INPUT_%s\" required=\"required\"", "size=\"16\" class=\"INPUT_%s\" required=\"required\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_LABEL_End (); HTM_LABEL_End ();
Btn_PutCreateButtonInline (Txt_Check); Btn_PutCreateButtonInline (Txt_Check);
@ -397,7 +397,7 @@ static void Acc_ShowFormRequestNewAccountWithPars (const char *NewNickWithoutArr
NewNickWithArr[0] = '\0'; NewNickWithArr[0] = '\0';
HTM_INPUT_TEXT ("NewNick",1 + Nck_MAX_CHARS_NICK_WITHOUT_ARROBA, HTM_INPUT_TEXT ("NewNick",1 + Nck_MAX_CHARS_NICK_WITHOUT_ARROBA,
NewNickWithArr,HTM_DONT_SUBMIT_ON_CHANGE, NewNickWithArr,HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"NewNick\" size=\"18\" placeholder=\"%s\"" "id=\"NewNick\" size=\"16\" placeholder=\"%s\""
" class=\"INPUT_%s\" required=\"required\"", " class=\"INPUT_%s\" required=\"required\"",
Txt_HELP_nickname, Txt_HELP_nickname,
The_GetSuffix ()); The_GetSuffix ());
@ -416,7 +416,7 @@ static void Acc_ShowFormRequestNewAccountWithPars (const char *NewNickWithoutArr
/* Data */ /* Data */
HTM_TD_Begin ("class=\"LT\""); HTM_TD_Begin ("class=\"LT\"");
HTM_INPUT_EMAIL ("NewEmail",Cns_MAX_CHARS_EMAIL_ADDRESS,NewEmail, HTM_INPUT_EMAIL ("NewEmail",Cns_MAX_CHARS_EMAIL_ADDRESS,NewEmail,
"id=\"NewEmail\" size=\"18\" placeholder=\"%s\"" "id=\"NewEmail\" size=\"16\" placeholder=\"%s\""
" class=\"INPUT_%s\" required=\"required\"", " class=\"INPUT_%s\" required=\"required\"",
Txt_HELP_email, Txt_HELP_email,
The_GetSuffix ()); The_GetSuffix ());

View File

@ -82,7 +82,8 @@ static void CtrCfg_Map (const struct Map_Coordinates *Coord);
static void CtrCfg_Latitude (double Latitude); static void CtrCfg_Latitude (double Latitude);
static void CtrCfg_Longitude (double Longitude); static void CtrCfg_Longitude (double Longitude);
static void CtrCfg_Altitude (double Altitude); static void CtrCfg_Altitude (double Altitude);
static void CtrCfg_Photo (Vie_ViewType_t ViewType,Frm_PutForm_t PutForm,bool PutLink, static void CtrCfg_Photo (Vie_ViewType_t ViewType,
Frm_PutForm_t PutForm,Hie_PutLink_t PutLink,
const char PathPhoto[PATH_MAX + 1]); const char PathPhoto[PATH_MAX + 1]);
static void CtrCfg_GetPhotoAttr (long CtrCod,char **PhotoAttribution); static void CtrCfg_GetPhotoAttr (long CtrCod,char **PhotoAttribution);
static void CtrCfg_FreePhotoAttr (char **PhotoAttribution); static void CtrCfg_FreePhotoAttr (char **PhotoAttribution);
@ -126,7 +127,7 @@ static void CtrCfg_Configuration (Vie_ViewType_t ViewType)
{ {
extern const char *Hlp_CENTER_Information; extern const char *Hlp_CENTER_Information;
struct Map_Coordinates Coord; struct Map_Coordinates Coord;
bool PutLink; Hie_PutLink_t PutLink;
Frm_PutForm_t PutFormIns; Frm_PutForm_t PutFormIns;
Frm_PutForm_t PutFormName; Frm_PutForm_t PutFormName;
Frm_PutForm_t PutFormPlc; Frm_PutForm_t PutFormPlc;
@ -145,7 +146,9 @@ static void CtrCfg_Configuration (Vie_ViewType_t ViewType)
Ctr_GetCoordByCod (Gbl.Hierarchy.Node[Hie_CTR].HieCod,&Coord); Ctr_GetCoordByCod (Gbl.Hierarchy.Node[Hie_CTR].HieCod,&Coord);
/***** Initializations *****/ /***** Initializations *****/
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_CTR].WWW[0]; PutLink = (ViewType == Vie_VIEW &&
Gbl.Hierarchy.Node[Hie_CTR].WWW[0]) ? Hie_PUT_LINK :
Hie_DONT_PUT_LINK;
PutFormIns = (ViewType == Vie_VIEW && PutFormIns = (ViewType == Vie_VIEW &&
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) ? Frm_PUT_FORM : Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) ? Frm_PUT_FORM :
Frm_DONT_PUT_FORM; Frm_DONT_PUT_FORM;
@ -427,7 +430,8 @@ static void CtrCfg_Altitude (double Altitude)
/***************************** Draw center photo *****************************/ /***************************** Draw center photo *****************************/
/*****************************************************************************/ /*****************************************************************************/
static void CtrCfg_Photo (Vie_ViewType_t ViewType,Frm_PutForm_t PutForm,bool PutLink, static void CtrCfg_Photo (Vie_ViewType_t ViewType,
Frm_PutForm_t PutForm,Hie_PutLink_t PutLink,
const char PathPhoto[PATH_MAX + 1]) const char PathPhoto[PATH_MAX + 1])
{ {
char *PhotoAttribution = NULL; char *PhotoAttribution = NULL;
@ -445,7 +449,7 @@ static void CtrCfg_Photo (Vie_ViewType_t ViewType,Frm_PutForm_t PutForm,bool Put
/***** Photo image *****/ /***** Photo image *****/
HTM_DIV_Begin ("class=\"CM\""); HTM_DIV_Begin ("class=\"CM\"");
if (PutLink) if (PutLink == Hie_PUT_LINK)
HTM_A_Begin ("href=\"%s\" target=\"_blank\"", HTM_A_Begin ("href=\"%s\" target=\"_blank\"",
Gbl.Hierarchy.Node[Hie_CTR].WWW); Gbl.Hierarchy.Node[Hie_CTR].WWW);
if (asprintf (&URL,"%s/%02u/%u", if (asprintf (&URL,"%s/%02u/%u",
@ -461,7 +465,7 @@ static void CtrCfg_Photo (Vie_ViewType_t ViewType,Frm_PutForm_t PutForm,bool Put
"CENTER_PHOTO_PRINT CENTER_PHOTO_WIDTH"); "CENTER_PHOTO_PRINT CENTER_PHOTO_WIDTH");
free (Icon); free (Icon);
free (URL); free (URL);
if (PutLink) if (PutLink == Hie_PUT_LINK)
HTM_A_End (); HTM_A_End ();
HTM_DIV_End (); HTM_DIV_End ();

View File

@ -633,10 +633,12 @@ Me sale este error, no s
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod') "can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
*/ */
#define Log_PLATFORM_VERSION "SWAD 23.44.3 (2023-11-06)" #define Log_PLATFORM_VERSION "SWAD 23.45 (2023-11-07)"
#define CSS_FILE "swad23.35.1.css" #define CSS_FILE "swad23.45.css"
#define JS_FILE "swad22.49.js" #define JS_FILE "swad22.49.js"
/* /*
Version 23.45: Nov 07, 2023 Improvements in responsive design. (335468 lines)
Version 23.44.4: Nov 06, 2023 Code refactoring in hierarchy. (335412 lines)
Version 23.44.3: Nov 06, 2023 Code refactoring in hierarchy. (335391 lines) Version 23.44.3: Nov 06, 2023 Code refactoring in hierarchy. (335391 lines)
Version 23.44.2: Nov 06, 2023 Code refactoring in hierarchy. (335532 lines) Version 23.44.2: Nov 06, 2023 Code refactoring in hierarchy. (335532 lines)
Version 23.44.1: Nov 06, 2023 Code refactoring in hierarchy. (335538 lines) Version 23.44.1: Nov 06, 2023 Code refactoring in hierarchy. (335538 lines)

View File

@ -60,11 +60,11 @@ extern struct Globals Gbl;
static void CtyCfg_Configuration (Vie_ViewType_t ViewType); static void CtyCfg_Configuration (Vie_ViewType_t ViewType);
static void CtyCfg_PutIconToPrint (__attribute__((unused)) void *Args); static void CtyCfg_PutIconToPrint (__attribute__((unused)) void *Args);
static void CtyCfg_Title (bool PutLink); static void CtyCfg_Title (Hie_PutLink_t PutLink);
static void CtyCfg_Map (void); static void CtyCfg_Map (void);
static void CtyCfg_MapImage (Vie_ViewType_t ViewType,bool PutLink); static void CtyCfg_MapImage (Vie_ViewType_t ViewType,Hie_PutLink_t PutLink);
static void CtyCfg_Platform (Vie_ViewType_t ViewType); static void CtyCfg_Platform (Vie_ViewType_t ViewType);
static void CtyCfg_Name (bool PutLink); static void CtyCfg_Name (Hie_PutLink_t PutLink);
static void CtyCfg_Shortcut (Vie_ViewType_t ViewType); static void CtyCfg_Shortcut (Vie_ViewType_t ViewType);
static void CtyCfg_QR (void); static void CtyCfg_QR (void);
static void CtyCfg_NumUsrs (void); static void CtyCfg_NumUsrs (void);
@ -103,7 +103,7 @@ void CtyCfg_PrintConfiguration (void)
static void CtyCfg_Configuration (Vie_ViewType_t ViewType) static void CtyCfg_Configuration (Vie_ViewType_t ViewType)
{ {
extern const char *Hlp_COUNTRY_Information; extern const char *Hlp_COUNTRY_Information;
bool PutLink; Hie_PutLink_t PutLink;
bool MapImageExists; bool MapImageExists;
unsigned NumCtrs; unsigned NumCtrs;
unsigned NumCtrsWithMap; unsigned NumCtrsWithMap;
@ -113,7 +113,9 @@ static void CtyCfg_Configuration (Vie_ViewType_t ViewType)
return; return;
/***** Initializations *****/ /***** Initializations *****/
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_CTY].WWW[0]; PutLink = (ViewType == Vie_VIEW &&
Gbl.Hierarchy.Node[Hie_CTY].WWW[0]) ? Hie_PUT_LINK :
Hie_DONT_PUT_LINK;
/***** Begin box *****/ /***** Begin box *****/
Box_BoxBegin (NULL,NULL, Box_BoxBegin (NULL,NULL,
@ -221,14 +223,14 @@ static void CtyCfg_PutIconToPrint (__attribute__((unused)) void *Args)
/******************** Show title in country configuration ********************/ /******************** Show title in country configuration ********************/
/*****************************************************************************/ /*****************************************************************************/
static void CtyCfg_Title (bool PutLink) static void CtyCfg_Title (Hie_PutLink_t PutLink)
{ {
/***** Begin container *****/ /***** Begin container *****/
HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG FRAME_TITLE_%s\"", HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG FRAME_TITLE_%s\"",
The_GetSuffix ()); The_GetSuffix ());
/* Begin link */ /* Begin link */
if (PutLink) if (PutLink == Hie_PUT_LINK)
HTM_A_Begin ("href=\"%s\" target=\"_blank\" title=\"%s\"" HTM_A_Begin ("href=\"%s\" target=\"_blank\" title=\"%s\""
" class=\"FRAME_TITLE_BIG FRAME_TITLE_%s\"", " class=\"FRAME_TITLE_BIG FRAME_TITLE_%s\"",
Gbl.Hierarchy.Node[Hie_CTY].WWW, Gbl.Hierarchy.Node[Hie_CTY].WWW,
@ -239,7 +241,7 @@ static void CtyCfg_Title (bool PutLink)
HTM_Txt (Gbl.Hierarchy.Node[Hie_CTY].FullName); HTM_Txt (Gbl.Hierarchy.Node[Hie_CTY].FullName);
/* End link */ /* End link */
if (PutLink) if (PutLink == Hie_PUT_LINK)
HTM_A_End (); HTM_A_End ();
/***** End container *****/ /***** End container *****/
@ -322,7 +324,7 @@ static void CtyCfg_Map (void)
/************* Show country map image in country configuration ***************/ /************* Show country map image in country configuration ***************/
/*****************************************************************************/ /*****************************************************************************/
static void CtyCfg_MapImage (Vie_ViewType_t ViewType,bool PutLink) static void CtyCfg_MapImage (Vie_ViewType_t ViewType,Hie_PutLink_t PutLink)
{ {
char *MapAttribution = NULL; char *MapAttribution = NULL;
@ -331,13 +333,13 @@ static void CtyCfg_MapImage (Vie_ViewType_t ViewType,bool PutLink)
/***** Map image *****/ /***** Map image *****/
HTM_DIV_Begin ("class=\"CM\""); HTM_DIV_Begin ("class=\"CM\"");
if (PutLink) if (PutLink == Hie_PUT_LINK)
HTM_A_Begin ("href=\"%s\" target=\"_blank\"", HTM_A_Begin ("href=\"%s\" target=\"_blank\"",
Gbl.Hierarchy.Node[Hie_CTY].WWW); Gbl.Hierarchy.Node[Hie_CTY].WWW);
Cty_DrawCountryMap (&Gbl.Hierarchy.Node[Hie_CTY], Cty_DrawCountryMap (&Gbl.Hierarchy.Node[Hie_CTY],
ViewType == Vie_VIEW ? "COUNTRY_MAP_SHOW" : ViewType == Vie_VIEW ? "COUNTRY_MAP_SHOW" :
"COUNTRY_MAP_PRINT"); "COUNTRY_MAP_PRINT");
if (PutLink) if (PutLink == Hie_PUT_LINK)
HTM_A_End (); HTM_A_End ();
HTM_DIV_End (); HTM_DIV_End ();
@ -406,7 +408,7 @@ static void CtyCfg_Platform (Vie_ViewType_t ViewType)
/**************** Show country name in country configuration *****************/ /**************** Show country name in country configuration *****************/
/*****************************************************************************/ /*****************************************************************************/
static void CtyCfg_Name (bool PutLink) static void CtyCfg_Name (Hie_PutLink_t PutLink)
{ {
extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS]; extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS];
@ -418,12 +420,12 @@ static void CtyCfg_Name (bool PutLink)
/* Data */ /* Data */
HTM_TD_Begin ("class=\"LB DAT_STRONG_%s\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"LB DAT_STRONG_%s\"",The_GetSuffix ());
if (PutLink) if (PutLink == Hie_PUT_LINK)
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"DAT_STRONG_%s\"", HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"DAT_STRONG_%s\"",
Gbl.Hierarchy.Node[Hie_CTY].WWW, Gbl.Hierarchy.Node[Hie_CTY].WWW,
The_GetSuffix ()); The_GetSuffix ());
HTM_Txt (Gbl.Hierarchy.Node[Hie_CTY].FullName); HTM_Txt (Gbl.Hierarchy.Node[Hie_CTY].FullName);
if (PutLink) if (PutLink == Hie_PUT_LINK)
HTM_A_End (); HTM_A_End ();
HTM_TD_End (); HTM_TD_End ();

View File

@ -152,6 +152,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
{ {
extern const char *Hlp_PROFILE_Courses; extern const char *Hlp_PROFILE_Courses;
extern const char *Par_CodeStr[]; extern const char *Par_CodeStr[];
extern ParCod_Param_t Hie_ParCod[Hie_NUM_LEVELS];
extern const char *Txt_My_courses; extern const char *Txt_My_courses;
extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS]; extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS];
struct Hie_Node Hie[Hie_NUM_LEVELS]; struct Hie_Node Hie[Hie_NUM_LEVELS];
@ -189,7 +190,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
IsLastItemInLevel[1] = true; IsLastItemInLevel[1] = true;
Lay_IndentDependingOnLevel (1,IsLastItemInLevel); Lay_IndentDependingOnLevel (1,IsLastItemInLevel);
Frm_BeginForm (ActMyCrs); Frm_BeginForm (ActMyCrs);
Par_PutParLong (NULL,Par_CodeStr[ParCod_Cty],-1L); Par_PutParLong (NULL,Par_CodeStr[Hie_ParCod[Hie_CTY]],-1L);
HTM_BUTTON_Submit_Begin (Txt_HIERARCHY_SINGUL_Abc[Hie_SYS], HTM_BUTTON_Submit_Begin (Txt_HIERARCHY_SINGUL_Abc[Hie_SYS],
"class=\"BT_LINK FORM_IN_%s\"", "class=\"BT_LINK FORM_IN_%s\"",
The_GetSuffix ()); The_GetSuffix ());
@ -221,7 +222,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
IsLastItemInLevel[2] = (NumCty == NumCtys - 1); IsLastItemInLevel[2] = (NumCty == NumCtys - 1);
Lay_IndentDependingOnLevel (2,IsLastItemInLevel); Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
Frm_BeginForm (ActMyCrs); Frm_BeginForm (ActMyCrs);
ParCod_PutPar (ParCod_Cty,Hie[Hie_CTY].HieCod); ParCod_PutPar (Hie_ParCod[Hie_CTY],Hie[Hie_CTY].HieCod);
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtyInf), HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtyInf),
"class=\"BT_LINK FORM_IN_%s\"", "class=\"BT_LINK FORM_IN_%s\"",
The_GetSuffix ()); The_GetSuffix ());
@ -254,7 +255,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
IsLastItemInLevel[3] = (NumIns == NumInss - 1); IsLastItemInLevel[3] = (NumIns == NumInss - 1);
Lay_IndentDependingOnLevel (3,IsLastItemInLevel); Lay_IndentDependingOnLevel (3,IsLastItemInLevel);
Frm_BeginForm (ActMyCrs); Frm_BeginForm (ActMyCrs);
ParCod_PutPar (ParCod_Ins,Hie[Hie_INS].HieCod); ParCod_PutPar (Hie_ParCod[Hie_INS],Hie[Hie_INS].HieCod);
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeInsInf), HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeInsInf),
"class=\"BT_LINK FORM_IN_%s\"", "class=\"BT_LINK FORM_IN_%s\"",
The_GetSuffix ()); The_GetSuffix ());
@ -289,7 +290,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
IsLastItemInLevel[4] = (NumCtr == NumCtrs - 1); IsLastItemInLevel[4] = (NumCtr == NumCtrs - 1);
Lay_IndentDependingOnLevel (4,IsLastItemInLevel); Lay_IndentDependingOnLevel (4,IsLastItemInLevel);
Frm_BeginForm (ActMyCrs); Frm_BeginForm (ActMyCrs);
ParCod_PutPar (ParCod_Ctr,Hie[Hie_CTR].HieCod); ParCod_PutPar (Hie_ParCod[Hie_CTR],Hie[Hie_CTR].HieCod);
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtrInf), HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtrInf),
"class=\"BT_LINK FORM_IN_%s\"", "class=\"BT_LINK FORM_IN_%s\"",
The_GetSuffix ()); The_GetSuffix ());
@ -324,7 +325,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
IsLastItemInLevel[5] = (NumDeg == NumDegs - 1); IsLastItemInLevel[5] = (NumDeg == NumDegs - 1);
Lay_IndentDependingOnLevel (5,IsLastItemInLevel); Lay_IndentDependingOnLevel (5,IsLastItemInLevel);
Frm_BeginForm (ActMyCrs); Frm_BeginForm (ActMyCrs);
ParCod_PutPar (ParCod_Deg,Hie[Hie_DEG].HieCod); ParCod_PutPar (Hie_ParCod[Hie_DEG],Hie[Hie_DEG].HieCod);
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeDegInf), HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeDegInf),
"class=\"BT_LINK FORM_IN_%s\"", "class=\"BT_LINK FORM_IN_%s\"",
The_GetSuffix ()); The_GetSuffix ());
@ -361,13 +362,19 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
IsLastItemInLevel[6] = (NumCrs == NumCrss - 1); IsLastItemInLevel[6] = (NumCrs == NumCrss - 1);
Lay_IndentDependingOnLevel (6,IsLastItemInLevel); Lay_IndentDependingOnLevel (6,IsLastItemInLevel);
Frm_BeginForm (ActMyCrs); Frm_BeginForm (ActMyCrs);
ParCod_PutPar (ParCod_Crs,Hie[Hie_CRS].HieCod); ParCod_PutPar (Hie_ParCod[Hie_CRS],Hie[Hie_CRS].HieCod);
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Hie[Hie_CRS].ShrtName), HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Hie[Hie_CRS].ShrtName),
"class=\"BT_LINK FORM_IN_%s\"", "class=\"BT_LINK FORM_IN_%s\"",
The_GetSuffix ()); The_GetSuffix ());
Str_FreeGoToTitle (); Str_FreeGoToTitle ();
Ico_PutIcon ("chalkboard-teacher.svg",Ico_BLACK,Hie[Hie_CRS].FullName,"ICO16x16"); // Ico_PutIcon ("chalkboard-teacher.svg",Ico_BLACK,Hie[Hie_CRS].FullName,"ICO16x16");
HTM_TxtF ("&nbsp;%s",Hie[Hie_CRS].ShrtName); Lgo_DrawLogo (Hie_CRS,
Hie[Hie_CRS].HieCod,
Hie[Hie_CRS].ShrtName,
16,NULL);
HTM_DIV_Begin ("class=\"MY_CRS_TXT\"");
HTM_TxtF ("&nbsp;%s",Hie[Hie_CRS].ShrtName);
HTM_DIV_End ();
HTM_BUTTON_End (); HTM_BUTTON_End ();
Frm_EndForm (); Frm_EndForm ();

View File

@ -77,7 +77,7 @@ static void CrsCfg_Indicators (void);
void CrsCfg_Configuration (Vie_ViewType_t ViewType) void CrsCfg_Configuration (Vie_ViewType_t ViewType)
{ {
extern const char *Hlp_COURSE_Information; extern const char *Hlp_COURSE_Information;
bool PutLink; Hie_PutLink_t PutLink;
Frm_PutForm_t PutFormDeg; Frm_PutForm_t PutFormDeg;
Frm_PutForm_t PutFormName; Frm_PutForm_t PutFormName;
Frm_PutForm_t PutFormYear; Frm_PutForm_t PutFormYear;
@ -88,7 +88,9 @@ void CrsCfg_Configuration (Vie_ViewType_t ViewType)
return; return;
/***** Initializations *****/ /***** Initializations *****/
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_DEG].WWW[0]; PutLink = (ViewType == Vie_VIEW &&
Gbl.Hierarchy.Node[Hie_DEG].WWW[0]) ? Hie_PUT_LINK :
Hie_DONT_PUT_LINK;
PutFormDeg = (ViewType == Vie_VIEW && PutFormDeg = (ViewType == Vie_VIEW &&
Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM) ? Frm_PUT_FORM : Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM) ? Frm_PUT_FORM :
Frm_DONT_PUT_FORM; Frm_DONT_PUT_FORM;
@ -380,7 +382,7 @@ static void CrsCfg_InstitutionalCode (Frm_PutForm_t PutForm)
HTM_INPUT_TEXT ("InsCrsCod",Hie_MAX_CHARS_INSTITUTIONAL_COD, HTM_INPUT_TEXT ("InsCrsCod",Hie_MAX_CHARS_INSTITUTIONAL_COD,
Gbl.Hierarchy.Node[Hie_CRS].InstitutionalCod, Gbl.Hierarchy.Node[Hie_CRS].InstitutionalCod,
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"id=\"InsCrsCod\" size=\"%u\"" "id=\"InsCrsCod\" maxlength=\"%u\""
" class=\"INPUT_INS_CODE INPUT_%s\"", " class=\"INPUT_INS_CODE INPUT_%s\"",
Hie_MAX_CHARS_INSTITUTIONAL_COD, Hie_MAX_CHARS_INSTITUTIONAL_COD,
The_GetSuffix ()); The_GetSuffix ());

View File

@ -144,16 +144,21 @@ unsigned Crs_DB_GetCourseDataByCod (MYSQL_RES **mysql_res,long CrsCod)
} }
/*****************************************************************************/ /*****************************************************************************/
/********************* Get degree code from course code **********************/ /************* Get the degree code of a course from its code *****************/
/*****************************************************************************/ /*****************************************************************************/
long Crs_DB_GetCurrentDegCodFromCurrentCrsCod (void) long Crs_DB_GetDegCodOfCourseByCod (long CrsCod)
{ {
/***** Trivial check: course code should be > 0 *****/
if (CrsCod <= 0)
return -1L;
/***** Get the degree code of a course from database *****/
return DB_QuerySELECTCode ("can not get the degree of a course", return DB_QuerySELECTCode ("can not get the degree of a course",
"SELECT DegCod" "SELECT DegCod"
" FROM crs_courses" " FROM crs_courses"
" WHERE CrsCod=%ld", " WHERE CrsCod=%ld",
Gbl.Hierarchy.Node[Hie_CRS].HieCod); CrsCod);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -41,7 +41,7 @@ unsigned Crs_DB_GetCrssInDeg (MYSQL_RES **mysql_res,long DegCod);
unsigned Crs_DB_GetCrssInCurrentDegBasic (MYSQL_RES **mysql_res); unsigned Crs_DB_GetCrssInCurrentDegBasic (MYSQL_RES **mysql_res);
unsigned Crs_DB_GetCrssInCurrentDegFull (MYSQL_RES **mysql_res); unsigned Crs_DB_GetCrssInCurrentDegFull (MYSQL_RES **mysql_res);
unsigned Crs_DB_GetCourseDataByCod (MYSQL_RES **mysql_res,long CrsCod); unsigned Crs_DB_GetCourseDataByCod (MYSQL_RES **mysql_res,long CrsCod);
long Crs_DB_GetCurrentDegCodFromCurrentCrsCod (void); long Crs_DB_GetDegCodOfCourseByCod (long CrsCod);
void Crs_DB_GetShortNamesByCod (long CrsCod, void Crs_DB_GetShortNamesByCod (long CrsCod,
char CrsShortName[Nam_MAX_BYTES_SHRT_NAME + 1], char CrsShortName[Nam_MAX_BYTES_SHRT_NAME + 1],
char DegShortName[Nam_MAX_BYTES_SHRT_NAME + 1]); char DegShortName[Nam_MAX_BYTES_SHRT_NAME + 1]);

View File

@ -95,7 +95,7 @@ void DegCfg_PrintConfiguration (void)
static void DegCfg_Configuration (Vie_ViewType_t ViewType) static void DegCfg_Configuration (Vie_ViewType_t ViewType)
{ {
extern const char *Hlp_DEGREE_Information; extern const char *Hlp_DEGREE_Information;
bool PutLink; Hie_PutLink_t PutLink;
Frm_PutForm_t PutFormCtr; Frm_PutForm_t PutFormCtr;
Frm_PutForm_t PutFormName; Frm_PutForm_t PutFormName;
Frm_PutForm_t PutFormWWW; Frm_PutForm_t PutFormWWW;
@ -105,7 +105,9 @@ static void DegCfg_Configuration (Vie_ViewType_t ViewType)
return; return;
/***** Initializations *****/ /***** Initializations *****/
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_DEG].WWW[0]; PutLink = (ViewType == Vie_VIEW &&
Gbl.Hierarchy.Node[Hie_DEG].WWW[0]) ? Hie_PUT_LINK :
Hie_DONT_PUT_LINK;
PutFormCtr = (ViewType == Vie_VIEW && PutFormCtr = (ViewType == Vie_VIEW &&
Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM) ? Frm_PUT_FORM : Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM) ? Frm_PUT_FORM :
Frm_DONT_PUT_FORM; Frm_DONT_PUT_FORM;

View File

@ -351,7 +351,7 @@ void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction,void (*FuncPars) (v
/***** Input box to enter user *****/ /***** Input box to enter user *****/
HTM_INPUT_TEXT ("OtherUsrIDNickOrEMail",Cns_MAX_CHARS_EMAIL_ADDRESS,"", HTM_INPUT_TEXT ("OtherUsrIDNickOrEMail",Cns_MAX_CHARS_EMAIL_ADDRESS,"",
HTM_DONT_SUBMIT_ON_CHANGE, HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"OtherUsrIDNickOrEMail\" size=\"18\"" "id=\"OtherUsrIDNickOrEMail\" size=\"16\""
" class=\"INPUT_%s\"" " class=\"INPUT_%s\""
" required=\"required\"", " required=\"required\"",
The_GetSuffix ()); The_GetSuffix ());

View File

@ -57,6 +57,19 @@
extern struct Globals Gbl; extern struct Globals Gbl;
/*****************************************************************************/
/**************************** Public constants ******************************/
/*****************************************************************************/
ParCod_Param_t Hie_ParCod[Hie_NUM_LEVELS] =
{
[Hie_CTY] = ParCod_Cty,
[Hie_INS] = ParCod_Ins,
[Hie_CTR] = ParCod_Ctr,
[Hie_DEG] = ParCod_Deg,
[Hie_CRS] = ParCod_Crs,
};
/*****************************************************************************/ /*****************************************************************************/
/**************************** Private constants ******************************/ /**************************** Private constants ******************************/
/*****************************************************************************/ /*****************************************************************************/
@ -115,14 +128,6 @@ void Hie_WriteMenuHierarchy (void)
{ {
extern const char *Par_CodeStr[]; extern const char *Par_CodeStr[];
extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS]; extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS];
static const char **Id[Hie_NUM_LEVELS] =
{
[Hie_CTY] = &Par_CodeStr[ParCod_Cty],
[Hie_INS] = &Par_CodeStr[ParCod_Ins],
[Hie_CTR] = &Par_CodeStr[ParCod_Ctr],
[Hie_DEG] = &Par_CodeStr[ParCod_Deg],
[Hie_CRS] = &Par_CodeStr[ParCod_Crs],
};
static void (*FunctionWriteSelector[Hie_NUM_LEVELS]) (void) = static void (*FunctionWriteSelector[Hie_NUM_LEVELS]) (void) =
{ {
[Hie_CTY] = Cty_WriteSelectorOfCountry, [Hie_CTY] = Cty_WriteSelectorOfCountry,
@ -145,7 +150,8 @@ void Hie_WriteMenuHierarchy (void)
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
/* Label */ /* Label */
Frm_LabelColumn ("RT",*Id[Level],Txt_HIERARCHY_SINGUL_Abc[Level]); Frm_LabelColumn ("RT",Par_CodeStr[Hie_ParCod[Level]],
Txt_HIERARCHY_SINGUL_Abc[Level]);
/* Data */ /* Data */
HTM_TD_Begin ("class=\"LT\""); HTM_TD_Begin ("class=\"LT\"");

View File

@ -34,6 +34,7 @@
#include "swad_figure_cache.h" #include "swad_figure_cache.h"
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_hierarchy_config.h"
#include "swad_HTML.h" #include "swad_HTML.h"
#include "swad_logo.h" #include "swad_logo.h"
#include "swad_QR.h" #include "swad_QR.h"
@ -48,17 +49,17 @@ extern struct Globals Gbl;
/************************ Show title in configuration ************************/ /************************ Show title in configuration ************************/
/*****************************************************************************/ /*****************************************************************************/
void HieCfg_Title (bool PutLink,Hie_Level_t Level) void HieCfg_Title (Hie_PutLink_t PutLink,Hie_Level_t Level)
{ {
Hie_Level_t LevelLogo = (Level == Hie_CRS) ? Hie_DEG : Hie_Level_t LevelLogo = (Level == Hie_CRS) ? Hie_DEG :
Level; Level;
/***** Begin container *****/ /***** Begin container *****/
HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG FRAME_TITLE_%s\"", HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG FRAME_TITLE_%s\"",
The_GetSuffix ()); The_GetSuffix ());
/* Begin link */ /* Begin link */
if (PutLink) if (PutLink == Hie_PUT_LINK)
HTM_A_Begin ("href=\"%s\" target=\"_blank\" title=\"%s\"" HTM_A_Begin ("href=\"%s\" target=\"_blank\" title=\"%s\""
" class=\"FRAME_TITLE_BIG FRAME_TITLE_%s\"", " class=\"FRAME_TITLE_BIG FRAME_TITLE_%s\"",
Gbl.Hierarchy.Node[LevelLogo].WWW, Gbl.Hierarchy.Node[LevelLogo].WWW,
@ -74,7 +75,7 @@ void HieCfg_Title (bool PutLink,Hie_Level_t Level)
HTM_Txt (Gbl.Hierarchy.Node[Level].FullName); HTM_Txt (Gbl.Hierarchy.Node[Level].FullName);
/* End link */ /* End link */
if (PutLink) if (PutLink == Hie_PUT_LINK)
HTM_A_End (); HTM_A_End ();
/***** End container *****/ /***** End container *****/

View File

@ -29,11 +29,21 @@
#include "swad_parameter_code.h" #include "swad_parameter_code.h"
/*****************************************************************************/
/************************** Public constants and types ***********************/
/*****************************************************************************/
typedef enum
{
Hie_DONT_PUT_LINK,
Hie_PUT_LINK,
} Hie_PutLink_t;
/*****************************************************************************/ /*****************************************************************************/
/***************************** Public prototypes *****************************/ /***************************** Public prototypes *****************************/
/*****************************************************************************/ /*****************************************************************************/
void HieCfg_Title (bool PutLink,Hie_Level_t LogoScope); void HieCfg_Title (Hie_PutLink_t PutLink,Hie_Level_t Level);
void HieCfg_Name (Frm_PutForm_t PutForm,Hie_Level_t Level, void HieCfg_Name (Frm_PutForm_t PutForm,Hie_Level_t Level,
Nam_ShrtOrFullName_t ShrtOrFull); Nam_ShrtOrFullName_t ShrtOrFull);
void HieCfg_WWW (Vie_ViewType_t ViewType,Frm_PutForm_t PutForm, void HieCfg_WWW (Vie_ViewType_t ViewType,Frm_PutForm_t PutForm,

View File

@ -47,6 +47,7 @@
#include "swad_forum_database.h" #include "swad_forum_database.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_hierarchy.h" #include "swad_hierarchy.h"
#include "swad_hierarchy_config.h"
#include "swad_hierarchy_type.h" #include "swad_hierarchy_type.h"
#include "swad_HTML.h" #include "swad_HTML.h"
#include "swad_institution.h" #include "swad_institution.h"
@ -207,9 +208,10 @@ void Ins_SeeInsWithPendingCtrs (void)
void Ins_DrawInstitutionLogoWithLink (struct Hie_Node *Ins,unsigned Size) void Ins_DrawInstitutionLogoWithLink (struct Hie_Node *Ins,unsigned Size)
{ {
bool PutLink = !Frm_CheckIfInside (); // Don't put link to institution if already inside a form Hie_PutLink_t PutLink = Frm_CheckIfInside () ? Hie_DONT_PUT_LINK : // Don't put link to institution if already inside a form
Hie_PUT_LINK;
if (PutLink) if (PutLink == Hie_PUT_LINK)
{ {
Frm_BeginForm (ActSeeInsInf); Frm_BeginForm (ActSeeInsInf);
ParCod_PutPar (ParCod_Ins,Ins->HieCod); ParCod_PutPar (ParCod_Ins,Ins->HieCod);
@ -219,7 +221,7 @@ void Ins_DrawInstitutionLogoWithLink (struct Hie_Node *Ins,unsigned Size)
Ins->HieCod, Ins->HieCod,
Ins->FullName, Ins->FullName,
Size,NULL); Size,NULL);
if (PutLink) if (PutLink == Hie_PUT_LINK)
{ {
HTM_BUTTON_End (); HTM_BUTTON_End ();
Frm_EndForm (); Frm_EndForm ();

View File

@ -104,7 +104,7 @@ void InsCfg_PrintConfiguration (void)
static void InsCfg_Configuration (Vie_ViewType_t ViewType) static void InsCfg_Configuration (Vie_ViewType_t ViewType)
{ {
extern const char *Hlp_INSTITUTION_Information; extern const char *Hlp_INSTITUTION_Information;
bool PutLink; Hie_PutLink_t PutLink;
Frm_PutForm_t PutFormCty; Frm_PutForm_t PutFormCty;
Frm_PutForm_t PutFormName; Frm_PutForm_t PutFormName;
Frm_PutForm_t PutFormWWW; Frm_PutForm_t PutFormWWW;
@ -116,7 +116,9 @@ static void InsCfg_Configuration (Vie_ViewType_t ViewType)
return; return;
/***** Initializations *****/ /***** Initializations *****/
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_INS].WWW[0]; PutLink = (ViewType == Vie_VIEW &&
Gbl.Hierarchy.Node[Hie_INS].WWW[0]) ? Hie_PUT_LINK :
Hie_DONT_PUT_LINK;
PutFormCty = PutFormCty =
PutFormName = (ViewType == Vie_VIEW && PutFormName = (ViewType == Vie_VIEW &&
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) ? Frm_PUT_FORM : Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) ? Frm_PUT_FORM :

View File

@ -34,8 +34,9 @@
#include "swad_action_list.h" #include "swad_action_list.h"
#include "swad_alert.h" #include "swad_alert.h"
#include "swad_box.h" #include "swad_box.h"
#include "swad_degree_database.h"
#include "swad_center_database.h" #include "swad_center_database.h"
#include "swad_course_database.h"
#include "swad_degree_database.h"
#include "swad_error.h" #include "swad_error.h"
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
@ -83,10 +84,11 @@ void Lgo_DrawLogo (Hie_Level_t Level,
[Hie_INS] = "university.svg", [Hie_INS] = "university.svg",
[Hie_CTR] = "building.svg", [Hie_CTR] = "building.svg",
[Hie_DEG] = "graduation-cap.svg", [Hie_DEG] = "graduation-cap.svg",
[Hie_CRS] = "chalkboard-teacher.svg",
}; };
const char *Folder = NULL; // To avoid warning const char *Folder = NULL; // To avoid warning
char PathLogo[PATH_MAX + 1]; char PathLogo[PATH_MAX + 1];
bool LogoFound = false; bool LogoFound;
long InsCod; long InsCod;
long CtrCod; long CtrCod;
long DegCod; long DegCod;
@ -99,11 +101,17 @@ void Lgo_DrawLogo (Hie_Level_t Level,
{ {
if (HieCod > 0) // Institution, center or degree exists if (HieCod > 0) // Institution, center or degree exists
{ {
/* Course */
LogoFound = false;
/* Degree */ /* Degree */
if (Level == Hie_DEG) if (!LogoFound && Level >= Hie_DEG)
{ {
Folder = Cfg_FOLDER_DEG; Folder = Cfg_FOLDER_DEG;
DegCod = HieCod; if (Level >= Hie_CRS) // && !LogoFound
DegCod = Crs_DB_GetDegCodOfCourseByCod (HieCod);
else
DegCod = HieCod;
snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png", snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png",
Cfg_PATH_DEG_PUBLIC, Cfg_PATH_DEG_PUBLIC,
(unsigned) (DegCod % 100), (unsigned) (DegCod % 100),
@ -115,11 +123,11 @@ void Lgo_DrawLogo (Hie_Level_t Level,
} }
/* Center */ /* Center */
if (!LogoFound && Level != Hie_INS) if (!LogoFound && Level >= Hie_CTR)
{ {
Folder = Cfg_FOLDER_CTR; Folder = Cfg_FOLDER_CTR;
if (Level == Hie_DEG) // && !LogoFound if (Level >= Hie_DEG) // && !LogoFound
CtrCod = Deg_DB_GetCtrCodOfDegreeByCod (HieCod); CtrCod = Deg_DB_GetCtrCodOfDegreeByCod (DegCod);
else else
CtrCod = HieCod; CtrCod = HieCod;
snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png", snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png",
@ -136,10 +144,8 @@ void Lgo_DrawLogo (Hie_Level_t Level,
if (!LogoFound) if (!LogoFound)
{ {
Folder = Cfg_FOLDER_INS; Folder = Cfg_FOLDER_INS;
if (Level == Hie_DEG) // && !LogoFound if (Level >= Hie_CTR) // && !LogoFound
InsCod = Deg_DB_GetInsCodOfDegreeByCod (HieCod); InsCod = Ctr_DB_GetInsCodOfCenterByCod (CtrCod);
else if (Level == Hie_CTR) // && !LogoFound
InsCod = Ctr_DB_GetInsCodOfCenterByCod (HieCod);
else else
InsCod = HieCod; InsCod = HieCod;
snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png", snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png",

View File

@ -1239,7 +1239,7 @@ static void Mai_ShowFormChangeUsrEmail (Usr_MeOrOther_t MeOrOther,
if (MeOrOther == Usr_OTHER) if (MeOrOther == Usr_OTHER)
Usr_PutParUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod); Usr_PutParUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
HTM_INPUT_EMAIL ("NewEmail",Cns_MAX_CHARS_EMAIL_ADDRESS,UsrDat[MeOrOther]->Email, HTM_INPUT_EMAIL ("NewEmail",Cns_MAX_CHARS_EMAIL_ADDRESS,UsrDat[MeOrOther]->Email,
"id=\"NewEmail\" class=\"INPUT_%s\" size=\"18\"", "id=\"NewEmail\" class=\"INPUT_%s\" size=\"16\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_BR (); HTM_BR ();
Btn_PutCreateButtonInline (NumEmails ? Txt_Change_email : // User already has an email address Btn_PutCreateButtonInline (NumEmails ? Txt_Change_email : // User already has an email address

View File

@ -1483,7 +1483,6 @@ static void Med_ShowMediaFile (const struct Med_Media *Media,const char *ClassMe
[Med_WEBM] = Med_ShowVideo, [Med_WEBM] = Med_ShowVideo,
[Med_OGG ] = Med_ShowVideo, [Med_OGG ] = Med_ShowVideo,
}; };
bool PutLink;
char PathMedPriv[PATH_MAX + 1]; char PathMedPriv[PATH_MAX + 1];
/***** If no media to show ==> nothing to do *****/ /***** If no media to show ==> nothing to do *****/
@ -1493,12 +1492,9 @@ static void Med_ShowMediaFile (const struct Med_Media *Media,const char *ClassMe
return; return;
/***** Begin optional link to external URL *****/ /***** Begin optional link to external URL *****/
PutLink = false;
if (Media->URL) if (Media->URL)
if (Media->URL[0]) if (Media->URL[0])
PutLink = true; HTM_A_Begin ("href=\"%s\" target=\"_blank\"",Media->URL);
if (PutLink)
HTM_A_Begin ("href=\"%s\" target=\"_blank\"",Media->URL);
/***** Build path to private directory with the media *****/ /***** Build path to private directory with the media *****/
snprintf (PathMedPriv,sizeof (PathMedPriv),"%s/%c%c", snprintf (PathMedPriv,sizeof (PathMedPriv),"%s/%c%c",
@ -1511,8 +1507,9 @@ static void Med_ShowMediaFile (const struct Med_Media *Media,const char *ClassMe
Show[Media->Type] (Media,PathMedPriv,ClassMedia); Show[Media->Type] (Media,PathMedPriv,ClassMedia);
/***** End optional link to external URL *****/ /***** End optional link to external URL *****/
if (PutLink) if (Media->URL)
HTM_A_End (); if (Media->URL[0])
HTM_A_End ();
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -315,7 +315,7 @@ static void Nck_ShowFormChangeUsrNickname (Usr_MeOrOther_t MeOrOther,
HTM_INPUT_TEXT ("NewNick",1 + Nck_MAX_CHARS_NICK_WITHOUT_ARROBA, HTM_INPUT_TEXT ("NewNick",1 + Nck_MAX_CHARS_NICK_WITHOUT_ARROBA,
NickWithArr,HTM_DONT_SUBMIT_ON_CHANGE, NickWithArr,HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"NewNick\" class=\"INPUT_%s\"" "id=\"NewNick\" class=\"INPUT_%s\""
" size=\"18\"", " size=\"16\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_BR (); HTM_BR ();
Btn_PutCreateButtonInline (NumNicks ? Txt_Change_nickname : // I already have a nickname Btn_PutCreateButtonInline (NumNicks ? Txt_Change_nickname : // I already have a nickname

View File

@ -208,7 +208,7 @@ void Prf_ReqUserProfile (void)
Gbl.Usrs.Me.UsrDat.Nickname); Gbl.Usrs.Me.UsrDat.Nickname);
HTM_INPUT_TEXT ("usr",sizeof (NickWithArr) - 1,NickWithArr, HTM_INPUT_TEXT ("usr",sizeof (NickWithArr) - 1,NickWithArr,
HTM_DONT_SUBMIT_ON_CHANGE, HTM_DONT_SUBMIT_ON_CHANGE,
"size=\"18\" class=\"INPUT_%s\"" "size=\"16\" class=\"INPUT_%s\""
" required=\"required\"", " required=\"required\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_LABEL_End (); HTM_LABEL_End ();

View File

@ -1647,16 +1647,16 @@ static void Prj_ShowProjectDepartment (const struct Prj_Projects *Projects,
const char *ClassData) const char *ClassData)
{ {
struct Dpt_Department Dpt; struct Dpt_Department Dpt;
bool PutLink; bool PutLinkToDpt;
/***** Get data of department *****/ /***** Get data of department *****/
Dpt.DptCod = Projects->Prj.DptCod; Dpt.DptCod = Projects->Prj.DptCod;
Dpt_GetDepartmentDataByCod (&Dpt); Dpt_GetDepartmentDataByCod (&Dpt);
/***** Show department *****/ /***** Show department *****/
PutLink = (Dpt.WWW[0] && PutLinkToDpt = (Dpt.WWW[0] &&
(Projects->View == Prj_LIST_PROJECTS || (Projects->View == Prj_LIST_PROJECTS ||
Projects->View == Prj_VIEW_ONE_PROJECT)); Projects->View == Prj_VIEW_ONE_PROJECT));
switch (Projects->View) switch (Projects->View)
{ {
@ -1669,13 +1669,15 @@ static void Prj_ShowProjectDepartment (const struct Prj_Projects *Projects,
ClassData,The_GetSuffix ()); ClassData,The_GetSuffix ());
break; break;
} }
if (PutLink)
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"%s_%s\"", if (PutLinkToDpt)
Dpt.WWW,ClassData,The_GetSuffix ()); HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"%s_%s\"",
HTM_Txt (Dpt.FullName); Dpt.WWW,ClassData,The_GetSuffix ());
if (PutLink) HTM_Txt (Dpt.FullName);
HTM_A_End (); if (PutLinkToDpt)
HTM_TD_End (); HTM_A_End ();
HTM_TD_End ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -2350,9 +2352,9 @@ static void Prj_ShowURL (const struct Prj_Projects *Projects,
const char *id,unsigned UniqueId) const char *id,unsigned UniqueId)
{ {
extern const char *Txt_URL; extern const char *Txt_URL;
bool PutLink = (Projects->Prj.URL[0] && bool PutLinkToURL = (Projects->Prj.URL[0] &&
(Projects->View == Prj_LIST_PROJECTS || (Projects->View == Prj_LIST_PROJECTS ||
Projects->View == Prj_VIEW_ONE_PROJECT)); Projects->View == Prj_VIEW_ONE_PROJECT));
/***** Write row with label and text *****/ /***** Write row with label and text *****/
switch (Projects->View) switch (Projects->View)
@ -2391,11 +2393,13 @@ static void Prj_ShowURL (const struct Prj_Projects *Projects,
ClassData,The_GetSuffix ()); ClassData,The_GetSuffix ());
break; break;
} }
if (PutLink)
if (PutLinkToURL)
HTM_A_Begin ("href=\"%s\" target=\"_blank\"",Projects->Prj.URL); HTM_A_Begin ("href=\"%s\" target=\"_blank\"",Projects->Prj.URL);
HTM_Txt (Projects->Prj.URL); HTM_Txt (Projects->Prj.URL);
if (PutLink) if (PutLinkToURL)
HTM_A_End (); HTM_A_End ();
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();

View File

@ -276,7 +276,7 @@ void Sch_PutInputStringToSearch (const char *IdInputText)
/***** String to find *****/ /***** String to find *****/
// Input field not required, because it can be hidden (display:none) // Input field not required, because it can be hidden (display:none)
HTM_INPUT_SEARCH ("Search",Sch_MAX_CHARS_STRING_TO_FIND,Search->Str, HTM_INPUT_SEARCH ("Search",Sch_MAX_CHARS_STRING_TO_FIND,Search->Str,
"id=\"%s\" size=\"18\" class=\"INPUT_%s\"" "id=\"%s\" size=\"16\" class=\"INPUT_%s\""
" placeholder=\"%s&hellip;\"", " placeholder=\"%s&hellip;\"",
IdInputText, IdInputText,
The_GetSuffix (), The_GetSuffix (),

View File

@ -1179,7 +1179,7 @@ void Usr_WriteFormLogin (Act_Action_t NextAction,void (*FuncPars) (void))
HTM_LABEL_End (); HTM_LABEL_End ();
HTM_INPUT_TEXT ("UsrId",Cns_MAX_CHARS_EMAIL_ADDRESS,Gbl.Usrs.Me.UsrIdLogin, HTM_INPUT_TEXT ("UsrId",Cns_MAX_CHARS_EMAIL_ADDRESS,Gbl.Usrs.Me.UsrIdLogin,
HTM_DONT_SUBMIT_ON_CHANGE, HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"UsrId\" size=\"18\" placeholder=\"%s\"" "id=\"UsrId\" size=\"16\" placeholder=\"%s\""
" class=\"INPUT_%s\" autofocus=\"autofocus\"" " class=\"INPUT_%s\" autofocus=\"autofocus\""
" required=\"required\"", " required=\"required\"",
Txt_nick_email_or_ID, Txt_nick_email_or_ID,