Version 14.44.1

This commit is contained in:
Antonio Cañas Vargas 2014-12-27 13:09:29 +01:00
parent e797b55f9b
commit ddd7ecdeaa
14 changed files with 82 additions and 57 deletions

View File

@ -59,7 +59,7 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
/****************** Title of current action in main block ********************/
#action_title
{
width:50%;
width:380px;
min-height:54px;
clear:both;
margin:0 auto;

View File

@ -439,7 +439,7 @@ void Acc_CreateNewUsr (struct UsrData *UsrDat)
"'%u','%s','%s','%s','%c',"
"'%ld',"
"'%s','%s','%s','%s','%s','%04u-%02u-%02u','%s',"
"'3','-1','0')",
"'%u','-1','0')",
UsrDat->EncryptedUsrCod,
UsrDat->Password,
UsrDat->Surname1,UsrDat->Surname2,UsrDat->FirstName,
@ -456,7 +456,8 @@ void Acc_CreateNewUsr (struct UsrData *UsrDat)
UsrDat->OriginPlace,
UsrDat->Birthday.Year,UsrDat->Birthday.Month,UsrDat->Birthday.Day,
UsrDat->Comments ? UsrDat->Comments :
"");
"",
Lay_SHOW_BOTH_COLUMNS);
UsrDat->UsrCod = DB_QueryINSERTandReturnCode (Query,"can not create user");
/* Insert user's IDs as confirmed */

View File

@ -336,7 +336,8 @@ static void Asg_ShowOneAssignment (long AsgCod)
Asg_GetAndWriteNamesOfGrpsAssociatedToAsg (&Asg);
fprintf (Gbl.F.Out,"<p align=\"justify\" class=\"%s\">"
"%s<br />&nbsp;</p></td>"
"%s<br />&nbsp;</p>"
"</td>"
"</tr>",
Asg.Hidden ? "DAT_LIGHT" :
"DAT",

View File

@ -35,11 +35,12 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 14.44 (2014/12/27)"
#define Log_PLATFORM_VERSION "SWAD 14.44.1 (2014/12/27)"
// 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 | tail -1
/*
Version 14.44.1 :Dic 27, 2014 Changes in layout columns. (174251 lines)
Version 14.44 :Dic 27, 2014 Removed vendor-specific properties in CSS. (174230 lines)
Version 14.43.1 :Dic 27, 2014 Fixed bugs in HTML and CSS. (174319 lines)
Version 14.43 :Dic 27, 2014 Changes in HTML and CSS to validate HTML5 in W3C validator. (174314 lines)

View File

@ -71,7 +71,9 @@
#define Cfg_ABOUT_LOGO_WIDTH 100
#define Cfg_ABOUT_LOGO_HEIGHT 32
#define Cfg_DEFAULT_COLUMNS Lay_SHOW_BOTH_COLUMNS
#define Cfg_DEFAULT_ACTION_WHEN_NO_USR_LOGGED ActFrmUsrAcc
#define Cfg_EXTERNAL_LOGIN_CLIENT_COMMAND "" // Client of the web service called by this CGI
#define Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME ""
#define Cfg_EXTERNAL_LOGIN_SERVICE_FULL_NAME ""
@ -116,7 +118,9 @@
#define Cfg_ABOUT_LOGO_WIDTH 32
#define Cfg_ABOUT_LOGO_HEIGHT 32
#define Cfg_DEFAULT_COLUMNS Lay_BOTH_COUMNS_HIDDEN
#define Cfg_DEFAULT_ACTION_WHEN_NO_USR_LOGGED ActFrmUsrAcc
#define Cfg_EXTERNAL_LOGIN_CLIENT_COMMAND "" // Client of the web service called by this CGI
#define Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME ""
#define Cfg_EXTERNAL_LOGIN_SERVICE_FULL_NAME ""
@ -178,7 +182,9 @@
#define Cfg_ABOUT_LOGO_WIDTH 100
#define Cfg_ABOUT_LOGO_HEIGHT 32
#define Cfg_DEFAULT_COLUMNS Lay_SHOW_BOTH_COLUMNS
#define Cfg_DEFAULT_ACTION_WHEN_NO_USR_LOGGED ActFrmLogIn
#define Cfg_EXTERNAL_LOGIN_CLIENT_COMMAND "./prado" // Client of the web service called by this CGI
#define Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME "PRADO"
#define Cfg_EXTERNAL_LOGIN_SERVICE_FULL_NAME "PRADO (Plataforma de Recursos de Apoyo a la Docencia)"
@ -230,7 +236,9 @@
#define Cfg_ABOUT_LOGO_WIDTH 100
#define Cfg_ABOUT_LOGO_HEIGHT 32
#define Cfg_DEFAULT_COLUMNS Lay_SHOW_BOTH_COLUMNS
#define Cfg_DEFAULT_ACTION_WHEN_NO_USR_LOGGED ActFrmLogIn
#define Cfg_EXTERNAL_LOGIN_CLIENT_COMMAND "" // Client of the web service called by this CGI
#define Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME ""
#define Cfg_EXTERNAL_LOGIN_SERVICE_FULL_NAME ""

View File

@ -130,7 +130,7 @@ void Gbl_InitializeGlobals (void)
sprintf (Gbl.Prefs.IconsURL,"%s/%s",
Cfg_HTTPS_URL_SWAD_PUBLIC,Cfg_FOLDER_PUBLIC_ICON);
Gbl.Prefs.Language = Txt_Current_CGI_SWAD_Language;
Gbl.Prefs.SideCols = 3; // Show both side columns, left and right
Gbl.Prefs.SideCols = Cfg_DEFAULT_COLUMNS; // Show both side columns, left and right
sprintf (Gbl.Prefs.PathTheme,"%s/%s/%s",
Gbl.Prefs.IconsURL,
Cfg_ICON_FOLDER_THEMES,

View File

@ -120,23 +120,6 @@ static void Lay_ShowRightColumn (void);
static void Lay_WriteFootFromHTMLFile (void);
/*****************************************************************************/
/*************** Print a SHA512 ciphered text in hexadecimal *****************/
/*****************************************************************************/
/*
void Lay_PrintDigest512 (unsigned char digest512[512/8])
{
unsigned i;
char Borrame[(512/8)*2+1];
for (i=0; i<(512/8); i++)
{
sprintf (&Borrame[i*2 ],"%01x",digest512[i] >> 4);
sprintf (&Borrame[i*2+1],"%01x",digest512[i] & 0x0F);
}
Lay_ShowAlert (Lay_INFO,Borrame);
}
*/
/*****************************************************************************/
/*********************** Write the start of the page *************************/
/*****************************************************************************/
@ -166,7 +149,7 @@ void Lay_WriteStartOfPage (void)
/***** Compute connected users *****/
if (Gbl.CurrentAct == ActLstCon ||
(Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP &&
(Gbl.Prefs.SideCols & 1) &&
(Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN) &&
Gbl.CurrentCrs.Crs.CrsCod >= 0)) // Right column visible && There is a course selected
Con_ComputeConnectedUsrsBelongingToCurrentCrs ();
@ -278,9 +261,9 @@ void Lay_WriteStartOfPage (void)
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP)
{
if (Gbl.Prefs.SideCols == 3) // 11: both side columns visible, left and right
if (Gbl.Prefs.SideCols == Lay_SHOW_BOTH_COLUMNS) // 11: both side columns visible, left and right
ColspanCentralPart = 1;
else if (Gbl.Prefs.SideCols != 0) // 10 or 01: only one side column visible, left or right
else if (Gbl.Prefs.SideCols != Lay_HIDE_BOTH_COLUMNS) // 10 or 01: only one side column visible, left or right
ColspanCentralPart = 2;
}
fprintf (Gbl.F.Out,"<td colspan=\"%u\" style=\"text-align:center;"
@ -508,7 +491,7 @@ static void Lay_WriteScriptInit (void)
}
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP &&
(Gbl.Prefs.SideCols & 1)) // Right column visible
(Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN)) // Right column visible
Con_WriteScriptClockConnected ();
// Put the focus on login form
@ -718,7 +701,7 @@ static void Lay_WritePageTopHeading (void)
{
case Lay_LAYOUT_DESKTOP:
/***** 3rd. row, 1st. column *****/
if (Gbl.Prefs.SideCols & 2) // Left column visible
if (Gbl.Prefs.SideCols & Lay_SHOW_LEFT_COLUMN) // Left column visible
fprintf (Gbl.F.Out,"<td style=\"width:128px;"
" text-align:center; vertical-align:top;"
" background-image:url('%s/head_base_background_1x56.gif');"
@ -730,7 +713,7 @@ static void Lay_WritePageTopHeading (void)
Lay_DrawTabs ();
/***** 3rd. row, 3rd. column *****/
if (Gbl.Prefs.SideCols & 1) // Right column visible
if (Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN) // Right column visible
{
fprintf (Gbl.F.Out,"<td rowspan=\"2\" style=\"width:128px;"
" text-align:center; vertical-align:top;\">");
@ -742,7 +725,7 @@ static void Lay_WritePageTopHeading (void)
"<tr>");
/***** 4th. row, 1st. column *****/
if (Gbl.Prefs.SideCols & 2) // Left column visible
if (Gbl.Prefs.SideCols & Lay_SHOW_LEFT_COLUMN) // Left column visible
{
fprintf (Gbl.F.Out,"<td style=\"width:128px; text-align:center;"
" vertical-align:top;\">");
@ -857,9 +840,9 @@ static void Lay_DrawTabs (void)
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP)
{
if (Gbl.Prefs.SideCols == 3) // 11: both side columns visible, left and right
if (Gbl.Prefs.SideCols == Lay_SHOW_BOTH_COLUMNS) // 11: both side columns visible, left and right
ColspanCentralPart = 1;
else if (Gbl.Prefs.SideCols != 0) // 10 or 01: only one side column visible, left or right
else if (Gbl.Prefs.SideCols != Lay_HIDE_BOTH_COLUMNS) // 10 or 01: only one side column visible, left or right
ColspanCentralPart = 2;
}
fprintf (Gbl.F.Out,"<td colspan=\"%u\" style=\"height:56px;"
@ -1700,7 +1683,7 @@ void Lay_RefreshNotifsAndConnected (void)
{
unsigned NumUsr;
bool ShowConnected = (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP &&
(Gbl.Prefs.SideCols & 1) &&
(Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN) &&
Gbl.CurrentCrs.Crs.CrsCod > 0); // Right column visible && There is a course selected
// Sometimes, someone must do this work, so who best than processes that refresh via AJAX?

View File

@ -49,6 +49,11 @@
#define Lay_MAX_BYTES_TITLE 1024 // Max. size for window status message
#define Lay_HIDE_BOTH_COLUMNS 0 // 00
#define Lay_SHOW_RIGHT_COLUMN 1 // 01
#define Lay_SHOW_LEFT_COLUMN 2 // 10
#define Lay_SHOW_BOTH_COLUMNS (Lay_SHOW_LEFT_COLUMN | Lay_SHOW_RIGHT_COLUMN) // 11
/*****************************************************************************/
/********************************* Public types ******************************/
/*****************************************************************************/

View File

@ -693,7 +693,9 @@ void Pwd_PutFormToGetNewPasswordTwice (void)
{
extern const char *The_ClassFormul[The_NUM_THEMES];
extern const char *Txt_New_password;
extern const char *Txt_Password;
extern const char *Txt_Retype_new_password;
extern const char *Txt_Retype_password;
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s\" style=\"text-align:right;\">"
@ -712,10 +714,12 @@ void Pwd_PutFormToGetNewPasswordTwice (void)
"</td>"
"</tr>",
The_ClassFormul[Gbl.Prefs.Theme],
Txt_New_password,
Gbl.Usrs.Me.Logged? Txt_New_password : // Changing my password
Txt_Password, // Creating new account
Pwd_INPUT_LENGTH_PLAIN_PASSWORD,Pwd_MAX_LENGTH_PLAIN_PASSWORD,
The_ClassFormul[Gbl.Prefs.Theme],
Txt_Retype_new_password,
Gbl.Usrs.Me.Logged ? Txt_Retype_new_password : // Changing my password
Txt_Retype_password, // Creating new account
Pwd_INPUT_LENGTH_PLAIN_PASSWORD,Pwd_MAX_LENGTH_PLAIN_PASSWORD);
}

View File

@ -206,11 +206,11 @@ void Prf_GetPrefsFromIP (void)
/* Get if user wants to show side columns (row[3]) */
if (sscanf (row[3],"%u",&Gbl.Prefs.SideCols) == 1)
{
if (Gbl.Prefs.SideCols > 3)
Gbl.Prefs.SideCols = 3; // Show both side columns
if (Gbl.Prefs.SideCols > Lay_SHOW_BOTH_COLUMNS)
Gbl.Prefs.SideCols = Lay_SHOW_BOTH_COLUMNS; // Show both side columns
}
else
Gbl.Prefs.SideCols = 3; // Show both side columns
Gbl.Prefs.SideCols = Cfg_DEFAULT_COLUMNS;
}
}
}
@ -390,7 +390,7 @@ void Prf_PutIconsToSelectSideCols (void)
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_1\">"
"<tr>");
for (SideCols = 0;
SideCols <= 3;
SideCols <= Lay_SHOW_BOTH_COLUMNS;
SideCols++)
{
fprintf (Gbl.F.Out,"<td class=\"%s\" style=\"text-align:center;\">",
@ -420,7 +420,7 @@ void Prf_PutLeftIconToHideShowCols (void)
extern const char *Txt_Hide_left_column;
extern const char *Txt_Show_left_column;
if (Gbl.Prefs.SideCols & 2)
if (Gbl.Prefs.SideCols & Lay_SHOW_LEFT_COLUMN)
{
Act_FormStart (ActHidLftCol);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/central_left_8x800.gif\""
@ -450,7 +450,7 @@ void Prf_PutRigthIconToHideShowCols (void)
extern const char *Txt_Hide_right_column;
extern const char *Txt_Show_right_column;
if (Gbl.Prefs.SideCols & 1)
if (Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN)
{
Act_FormStart (ActHidRgtCol);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/central_right_8x800.gif\""
@ -494,7 +494,7 @@ void Prf_ChangeSideCols (void)
void Prf_HideLeftCol (void)
{
Gbl.Prefs.SideCols &= 1; // And with 01 to hide left column
Gbl.Prefs.SideCols &= ~Lay_SHOW_LEFT_COLUMN; // And with 1...101 to hide left column
if (Gbl.Usrs.Me.Logged)
Prf_UpdateSideColsOnUsrDataTable ();
@ -508,7 +508,7 @@ void Prf_HideLeftCol (void)
void Prf_HideRightCol (void)
{
Gbl.Prefs.SideCols &= 2; // And with 10 to hide right column
Gbl.Prefs.SideCols &= ~Lay_SHOW_RIGHT_COLUMN; // And with 1...110 to hide right column
if (Gbl.Usrs.Me.Logged)
Prf_UpdateSideColsOnUsrDataTable ();
@ -522,7 +522,7 @@ void Prf_HideRightCol (void)
void Prf_ShowLeftCol (void)
{
Gbl.Prefs.SideCols |= 2; // Or with 10 to show left column
Gbl.Prefs.SideCols |= Lay_SHOW_LEFT_COLUMN; // Or with 10 to show left column
if (Gbl.Usrs.Me.Logged)
Prf_UpdateSideColsOnUsrDataTable ();
@ -536,7 +536,7 @@ void Prf_ShowLeftCol (void)
void Prf_ShowRightCol (void)
{
Gbl.Prefs.SideCols |= 1; // Or with 01 to show right column
Gbl.Prefs.SideCols |= Lay_SHOW_RIGHT_COLUMN; // Or with 01 to show right column
if (Gbl.Usrs.Me.Logged)
Prf_UpdateSideColsOnUsrDataTable ();
@ -569,13 +569,13 @@ unsigned Prf_GetParamSideCols (void)
Par_GetParToText ("SideCols",UnsignedStr,10);
if (!UnsignedStr[0])
return 3;
return Cfg_DEFAULT_COLUMNS;
if (sscanf (UnsignedStr,"%u",&UnsignedNum) != 1)
return 3;
return Cfg_DEFAULT_COLUMNS;
if (UnsignedNum > 3)
return 3;
return Cfg_DEFAULT_COLUMNS;
return UnsignedNum;
}

View File

@ -31,7 +31,6 @@
/***************************** Public constants ******************************/
/*****************************************************************************/
/*****************************************************************************/
/******************************* Public types ********************************/
/*****************************************************************************/

View File

@ -6251,14 +6251,15 @@ static void Sta_GetAndShowNumUsrsPerColumns (void)
/***** For each language... *****/
for (SideCols = 0;
SideCols <= 3;
SideCols <= Lay_SHOW_BOTH_COLUMNS;
SideCols++)
{
/***** Get the number of users who have chosen this layout of columns from database *****/
switch (Gbl.Scope.Current)
{
case Sco_SCOPE_PLATFORM:
sprintf (Query,"SELECT COUNT(*) FROM usr_data WHERE SideCols='%u'",SideCols);
sprintf (Query,"SELECT COUNT(*) FROM usr_data WHERE SideCols='%u'",
SideCols);
break;
case Sco_SCOPE_INSTITUTION:
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
@ -6310,7 +6311,7 @@ static void Sta_GetAndShowNumUsrsPerColumns (void)
/***** Write number of users who have chosen this layout of columns *****/
for (SideCols = 0;
SideCols <= 3;
SideCols <= Lay_SHOW_BOTH_COLUMNS;
SideCols++)
fprintf (Gbl.F.Out,"<tr>"
"<td style=\"text-align:center;\">"
@ -6324,7 +6325,8 @@ static void Sta_GetAndShowNumUsrsPerColumns (void)
"%5.2f%%"
"</td>"
"</tr>",
Gbl.Prefs.IconsURL,SideCols >> 1,SideCols & 1,Txt_LAYOUT_SIDE_COLUMNS[SideCols],
Gbl.Prefs.IconsURL,SideCols >> 1,SideCols & 1,
Txt_LAYOUT_SIDE_COLUMNS[SideCols],
NumUsrs[SideCols],
NumUsrsTotal ? (float) NumUsrs[SideCols] * 100.0 /
(float) NumUsrsTotal :

View File

@ -30624,6 +30624,27 @@ const char *Txt_Retype_new_password =
"Redigite a nova senha";
#endif
const char *Txt_Retype_password =
#if L==0
"Reescriviu la contrasenya";
#elif L==1
"Wiederholung Passwort";
#elif L==2
"Retype password";
#elif L==3
"Reescriba la contrase&ntilde;a";
#elif L==4
"Confirmez votre mot de passe";
#elif L==5
"Reescriba la contrase&ntilde;a"; // Okoteve traducción
#elif L==6
"Riscrivi la password";
#elif L==7
"Powt&oacute;rz has&lstrok;o";
#elif L==8
"Redigite a senha";
#endif
const char *Txt_Role =
#if L==0
"Rol";

View File

@ -266,7 +266,7 @@ void Usr_ResetUsrDataExceptUsrCodAndIDs (struct UsrData *UsrDat)
UsrDat->Prefs.Language = Cfg_DEFAULT_LANGUAGE_FOR_NEW_USERS;
UsrDat->Prefs.Layout = Lay_LAYOUT_DEFAULT;
UsrDat->Prefs.Theme = The_THEME_DEFAULT;
UsrDat->Prefs.SideCols = 3;
UsrDat->Prefs.SideCols = Cfg_DEFAULT_COLUMNS;
UsrDat->Prefs.IconSet = Ico_ICON_SET_DEFAULT;
UsrDat->Prefs.EmailNtfEvents = 0; // By default, don't notify anything
}
@ -497,11 +497,11 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat)
/* Get if user wants to show side columns */
if (sscanf (row[26],"%u",&UsrDat->Prefs.SideCols) == 1)
{
if (UsrDat->Prefs.SideCols > 3)
UsrDat->Prefs.SideCols = 3; // Show both side columns
if (UsrDat->Prefs.SideCols > Lay_SHOW_BOTH_COLUMNS)
UsrDat->Prefs.SideCols = Lay_SHOW_BOTH_COLUMNS; // Show both side columns
}
else
UsrDat->Prefs.SideCols = 3; // Show both side columns
UsrDat->Prefs.SideCols = Cfg_DEFAULT_COLUMNS;
/* Get on which events I want to be notified by e-mail */
if (sscanf (row[27],"%u",&UsrDat->Prefs.NotifNtfEvents) != 1)