Version19.72.1

This commit is contained in:
Antonio Cañas Vargas 2019-11-19 00:17:23 +01:00
parent 5a2bb0aa92
commit 055c30bf79
19 changed files with 94 additions and 83 deletions

View File

@ -3881,6 +3881,7 @@ a.PAG:hover, .PAG_CUR
box-sizing:border-box;
width:100px;
height:90px;
text-align:left;
}
.FOLLOW_USR_NAME
{

View File

@ -1295,7 +1295,7 @@ void HTM_INPUT_CHECKBOX (const char *Name,bool SubmitOnChange,
void HTM_BUTTON_OnMouseDown_Begin (const char *Class)
{
fprintf (Gbl.F.Out,"<button type=\"submit\" class=\"%s\""
" onmousedown=\"document.getElementById('%s').submit();return false;\" />",
" onmousedown=\"document.getElementById('%s').submit();return false;\">",
Class,Gbl.Form.Id);
HTM_BUTTON_NestingLevel++;
}
@ -1313,7 +1313,26 @@ void HTM_BUTTON_Begin (const char *Title,const char *Class,const char *OnSubmit)
// before submitting the form
if (OnSubmit[0])
HTM_TxtF ("onsubmit=\"%s;\"",OnSubmit);
fprintf (Gbl.F.Out," />");
fprintf (Gbl.F.Out,">");
HTM_BUTTON_NestingLevel++;
}
void HTM_BUTTON_Animated_Begin (const char *Title,const char *Class,const char *OnClick)
{
fprintf (Gbl.F.Out,"<button type=\"submit\"");
if (Title)
if (Title[0])
HTM_TxtF (" title=\"%s\"",Title);
if (Class)
if (Class[0])
HTM_TxtF (" class=\"%s\"",Class);
HTM_Txt (" onclick=\"");
if (OnClick) // JavaScript function to be called
// before submitting the form
if (OnClick[0])
HTM_TxtF ("%s",OnClick);
HTM_TxtF ("AnimateIcon(%d);\">",Gbl.Form.Num);
HTM_BUTTON_NestingLevel++;
}

View File

@ -136,6 +136,7 @@ void HTM_INPUT_CHECKBOX (const char *Name,bool SubmitOnChange,
void HTM_BUTTON_OnMouseDown_Begin (const char *Class);
void HTM_BUTTON_Begin (const char *Title,const char *Class,const char *OnSubmit);
void HTM_BUTTON_Animated_Begin (const char *Title,const char *Class,const char *OnClick);
void HTM_BUTTON_End (void);
void HTM_TEXTAREA_Begin (const char *fmt,...);

View File

@ -3024,7 +3024,7 @@ static void Att_PutButtonToShowDetails (void)
static void Att_ListEventsToSelect (void)
{
extern const char *The_ClassFormInBoxBold[The_NUM_THEMES];
extern const char *The_ClassFormLinkInBoxBold[The_NUM_THEMES];
extern const char *Txt_Events;
extern const char *Txt_Event;
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
@ -3118,11 +3118,11 @@ static void Att_ListEventsToSelect (void)
HTM_TR_Begin (NULL);
HTM_TD_Begin ("colspan=\"5\" class=\"CM\"");
Frm_LinkFormSubmitAnimated (Txt_Update_attendance,
The_ClassFormInBoxBold[Gbl.Prefs.Theme],
NULL);
HTM_BUTTON_Animated_Begin (Txt_Update_attendance,
The_ClassFormLinkInBoxBold[Gbl.Prefs.Theme],
NULL);
Ico_PutCalculateIconWithText (Txt_Update_attendance);
Frm_LinkFormEnd ();
HTM_BUTTON_End ();
HTM_TD_End ();
HTM_TR_End ();

View File

@ -488,13 +488,15 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.71.3 (2019-11-17)"
#define Log_PLATFORM_VERSION "SWAD 19.72.1 (2019-11-18)"
#define CSS_FILE "swad19.71.css"
#define JS_FILE "swad19.70.js"
/*
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
// TODO: Impedir la creación y edición de proyectos si no son editables.
Version 19.72.1: Nov 18, 2019 Fixed bugs related to buttons. (247023 lines)
Version 19.72: Nov 17, 2019 Converted animated links to buttons. (247014 lines)
Version 19.71.3: Nov 17, 2019 Converting links to buttons. (247013 lines)
Version 19.71.2: Nov 17, 2019 Converting links to buttons. (247034 lines)
Version 19.71.1: Nov 17, 2019 Converting links to buttons.

View File

@ -128,9 +128,9 @@ static void Con_PutIconToUpdateConnected (void)
Frm_StartForm (ActLstCon);
Sco_PutParamScope ("ScopeCon",Gbl.Scope.Current);
Frm_LinkFormSubmitAnimated (Txt_Update,NULL,NULL);
HTM_BUTTON_Animated_Begin (Txt_Update,"BT_LINK",NULL);
Ico_PutCalculateIcon (Txt_Update);
Frm_LinkFormEnd ();
HTM_BUTTON_End ();
Frm_EndForm ();
}
@ -166,7 +166,7 @@ void Con_ShowGlobalConnectedUsrs (void)
Frm_StartFormUnique (ActLstCon); // Must be unique because
// the list of connected users
// is dynamically updated via AJAX
HTM_BUTTON_Begin (Txt_Connected_users,"CONNECTED_TXT",NULL);
HTM_BUTTON_Begin (Txt_Connected_users,"BT_LINK CONNECTED_TXT",NULL);
/* Write total number of sessions */
HTM_TxtF ("%u&nbsp;%s",Gbl.Session.NumSessions,
@ -314,7 +314,7 @@ void Con_ShowConnectedUsrsBelongingToCurrentCrs (void)
Frm_StartFormUnique (ActLstCon); // Must be unique because
// the list of connected users
// is dynamically updated via AJAX
HTM_BUTTON_Begin (Txt_Connected_users,"CONNECTED_TXT",NULL);
HTM_BUTTON_Begin (Txt_Connected_users,"BT_LINK CONNECTED_TXT",NULL);
Str_Copy (CourseName,Gbl.Hierarchy.Crs.ShrtName,
Hie_MAX_BYTES_SHRT_NAME);
Con_GetNumConnectedUsrsWithARoleBelongingCurrentLocation (Rol_UNK,&Usrs);
@ -889,7 +889,8 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
time_t TimeDiff;
bool ShowPhoto;
char PhotoURL[PATH_MAX + 1];
const char *Font;
const char *ClassTxt;
const char *ClassLink;
struct UsrData UsrDat;
bool PutLinkToRecord = (Gbl.Hierarchy.Level == Hie_CRS && // Course selected
Gbl.Scope.Current == Hie_CRS && // Scope is current course
@ -1044,9 +1045,17 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
HTM_TD_End ();
/***** Write full name and link *****/
Font = (ThisCrs ? "BT_LINK CON_NAME_WIDE CON_CRS" :
"BT_LINK CON_NAME_WIDE CON_NO_CRS");
HTM_TD_Begin ("class=\"%s COLOR%u\"",Font,Gbl.RowEvenOdd);
if (ThisCrs)
{
ClassTxt = "CON_NAME_WIDE CON_CRS";
ClassLink = "BT_LINK CON_NAME_WIDE CON_CRS";
}
else
{
ClassTxt = "CON_NAME_WIDE CON_NO_CRS";
ClassLink = "BT_LINK CON_NAME_WIDE CON_NO_CRS";
}
HTM_TD_Begin ("class=\"%s COLOR%u\"",ClassTxt,Gbl.RowEvenOdd);
if (PutLinkToRecord)
{
switch (Role)
@ -1066,7 +1075,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
HTM_DIV_Begin ("class=\"CON_NAME_WIDE\""); // Limited width
if (PutLinkToRecord)
HTM_BUTTON_Begin (UsrDat.FullName,Font,NULL);
HTM_BUTTON_Begin (UsrDat.FullName,ClassLink,NULL);
Usr_WriteFirstNameBRSurnames (&UsrDat);
if (PutLinkToRecord)
HTM_BUTTON_End ();
@ -1077,9 +1086,9 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
HTM_TD_End ();
/***** Write time from last access *****/
Font = (ThisCrs ? "CON_SINCE CON_CRS" :
"CON_SINCE CON_NO_CRS");
HTM_TD_Begin ("class=\"%s COLOR%u\"",Font,Gbl.RowEvenOdd);
ClassTxt = ThisCrs ? "CON_SINCE CON_CRS" :
"CON_SINCE CON_NO_CRS";
HTM_TD_Begin ("class=\"%s COLOR%u\"",ClassTxt,Gbl.RowEvenOdd);
Dat_WriteHoursMinutesSecondsFromSeconds (TimeDiff);
HTM_TD_End ();

View File

@ -2841,7 +2841,6 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected)
Crs.FullName);
HTM_BUTTON_Begin (Gbl.Title,"BT_LINK DAT",NULL);
HTM_TxtF ("%s &gt; %s",Deg.ShrtName,Crs.ShrtName);
Frm_LinkFormEnd ();
HTM_BUTTON_End ();
HTM_TD_End ();

View File

@ -1430,9 +1430,6 @@ static void Fig_ShowInss (MYSQL_RES **mysql_res,unsigned NumInss,
HTM_Unsigned (NumberThisRow);
HTM_TD_End ();
/***** End user's cell *****/
HTM_TD_End ();
if ((++NumIns % Gbl.Usrs.ClassPhoto.Cols) == 0)
{
HTM_TR_End ();

View File

@ -436,9 +436,9 @@ static void Fol_PutIconToUpdateWhoToFollow (void)
extern const char *Txt_Update;
Frm_StartForm (ActSeeSocPrf);
Frm_LinkFormSubmitAnimated (Txt_Update,NULL,NULL);
HTM_BUTTON_Animated_Begin (Txt_Update,"BT_LINK",NULL);
Ico_PutCalculateIcon (Txt_Update);
Frm_LinkFormEnd ();
HTM_BUTTON_End ();
Frm_EndForm ();
}
@ -842,7 +842,7 @@ static void Fol_ShowFollowedOrFollower (struct UsrData *UsrDat)
Frm_StartForm (ActSeeOthPubPrf);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
HTM_DIV_Begin ("class=\"FOLLOW_USR_NAME\""); // Limited width
HTM_BUTTON_Begin (Txt_Another_user_s_profile,"BT_LINK DAT",NULL);
HTM_BUTTON_Begin (Txt_Another_user_s_profile,"BT_LINK LT DAT",NULL);
Usr_WriteFirstNameBRSurnames (UsrDat);
HTM_BUTTON_End ();
HTM_DIV_End ();
@ -892,14 +892,14 @@ static void Fol_WriteRowUsrToFollowOnRightColumn (struct UsrData *UsrDat)
HTM_TD_End ();
/***** User's name *****/
HTM_TD_Begin ("class=\"CON_NAME_FOLLOW CON_CRS COLOR%u\"",Gbl.RowEvenOdd);
HTM_TD_Begin ("class=\"CON_NAME_FOLLOW COLOR%u\"",Gbl.RowEvenOdd);
if (Visible)
{
/* Put form to go to public profile */
Frm_StartForm (ActSeeOthPubPrf);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
HTM_DIV_Begin ("class=\"CON_NAME_FOLLOW\""); // Limited width
HTM_BUTTON_Begin (Txt_Another_user_s_profile,"BT_LINK CON_CRS",NULL);
HTM_BUTTON_Begin (Txt_Another_user_s_profile,"BT_LINK CON_NAME_FOLLOW CON_CRS",NULL);
Usr_WriteFirstNameBRSurnames (UsrDat);
HTM_BUTTON_End ();
HTM_DIV_End ();

View File

@ -231,32 +231,6 @@ void Frm_EndForm (void)
}
}
void Frm_LinkFormSubmitAnimated (const char *Title,const char *LinkClass,
const char *OnSubmit)
{
HTM_Txt ("<a href=\"\"");
if (Title)
if (Title[0])
HTM_TxtF (" title=\"%s\"",Title);
if (LinkClass)
if (LinkClass[0])
HTM_TxtF (" class=\"%s\"",LinkClass);
HTM_Txt (" onclick=\"");
if (OnSubmit) // JavaScript function to be called
// before submitting the form
if (OnSubmit[0])
HTM_TxtF ("%s",OnSubmit);
HTM_TxtF ("AnimateIcon(%d);"
"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Num,
Gbl.Form.Id);
}
void Frm_LinkFormEnd (void)
{
HTM_Txt ("</a>");
}
/*****************************************************************************/
/***************************** Get unique Id *********************************/
/*****************************************************************************/

View File

@ -62,9 +62,6 @@ void Frm_StartFormId (Act_Action_t NextAction,const char *Id);
void Frm_SetParamsForm (char ParamsStr[Frm_MAX_BYTES_PARAMS_STR],Act_Action_t NextAction,
bool PutParameterLocationIfNoSesion);
void Frm_EndForm (void);
void Frm_LinkFormSubmitAnimated (const char *Title,const char *LinkClass,
const char *OnSubmit);
void Frm_LinkFormEnd (void);
void Frm_SetUniqueId (char UniqueId[Frm_MAX_BYTES_ID + 1]);

View File

@ -2104,7 +2104,7 @@ static void For_WriteLinkToForum (struct Forum *Forum,
For_WriteNumberOfThrs (NumThrs);
/***** End row *****/
Frm_LinkFormEnd ();
HTM_BUTTON_End ();
Frm_EndForm ();
/***** Put link to register students *****/

View File

@ -360,7 +360,7 @@ void Grp_ShowFormToSelectSeveralGroups (void (*FuncParams) (void),
Grp_WhichGroups_t GroupsSelectableByStdsOrNETs)
{
extern const char *Hlp_USERS_Groups;
extern const char *The_ClassFormInBoxBold[The_NUM_THEMES];
extern const char *The_ClassFormLinkInBoxBold[The_NUM_THEMES];
extern const char *Txt_Groups;
extern const char *Txt_Update_users;
unsigned NumGrpTyp;
@ -407,12 +407,12 @@ void Grp_ShowFormToSelectSeveralGroups (void (*FuncParams) (void),
/***** Submit button *****/
HTM_DIV_Begin ("class=\"CM\" style=\"padding-top:12px;\"");
Frm_LinkFormSubmitAnimated (Txt_Update_users,
The_ClassFormInBoxBold[Gbl.Prefs.Theme],
Gbl.Action.Act == ActReqMsgUsr ? "CopyMessageToHiddenFields();" :
NULL);
HTM_BUTTON_Animated_Begin (Txt_Update_users,
The_ClassFormLinkInBoxBold[Gbl.Prefs.Theme],
Gbl.Action.Act == ActReqMsgUsr ? "CopyMessageToHiddenFields();" :
NULL);
Ico_PutCalculateIconWithText (Txt_Update_users);
Frm_LinkFormEnd ();
HTM_BUTTON_End ();
HTM_DIV_End ();
/***** End form *****/

View File

@ -27,6 +27,7 @@
#define _GNU_SOURCE // For asprintf
#include <stdio.h> // For fprintf, asprintf, etc.
#include <stdlib.h> // For free
#include <string.h> // For string functions
#include "swad_config.h"

View File

@ -1688,7 +1688,7 @@ static void Msg_ShowSentOrReceivedMessages (void)
extern const char *Hlp_MESSAGES_Received_filter;
extern const char *Hlp_MESSAGES_Sent;
extern const char *Hlp_MESSAGES_Sent_filter;
extern const char *The_ClassFormInBoxBold[The_NUM_THEMES];
extern const char *The_ClassFormLinkInBoxBold[The_NUM_THEMES];
extern const char *Txt_Filter;
extern const char *Txt_Update_messages;
char FilterFromToSubquery[Msg_MAX_BYTES_MESSAGES_QUERY + 1];
@ -1771,11 +1771,11 @@ static void Msg_ShowSentOrReceivedMessages (void)
/***** Contextual menu *****/
Mnu_ContextMenuBegin ();
Frm_LinkFormSubmitAnimated (Txt_Update_messages,
The_ClassFormInBoxBold[Gbl.Prefs.Theme],
NULL);
HTM_BUTTON_Animated_Begin (Txt_Update_messages,
The_ClassFormLinkInBoxBold[Gbl.Prefs.Theme],
NULL);
Ico_PutCalculateIconWithText (Txt_Update_messages); // Animated icon to update messages
Frm_LinkFormEnd ();
HTM_BUTTON_End ();
Mnu_ContextMenuEnd ();
Frm_EndForm ();

View File

@ -28,6 +28,7 @@
#define _GNU_SOURCE // For asprintf
#include <linux/stddef.h> // For NULL
#include <stdio.h> // For asprintf
#include <stdlib.h> // For free
#include "swad_action.h"
#include "swad_database.h"

View File

@ -1996,7 +1996,7 @@ static void Pho_PutLinkToPrintViewOfDegreeStatsParams (void)
static void Pho_PutLinkToCalculateDegreeStats (void)
{
extern const char *The_ClassFormInBoxBold[The_NUM_THEMES];
extern const char *The_ClassFormLinkInBoxBold[The_NUM_THEMES];
extern const char *Txt_Calculate_average_photo_of_THE_DEGREE_X;
extern const char *Txt_unknown_TIME;
extern const char *Txt_time;
@ -2025,11 +2025,11 @@ static void Pho_PutLinkToCalculateDegreeStats (void)
Pho_PutHiddenParamPhotoSize ();
Pho_PutHiddenParamOrderDegrees ();
Usr_PutParamsPrefsAboutUsrList ();
Frm_LinkFormSubmitAnimated (Txt_Calculate_average_photo_of_THE_DEGREE_X,
The_ClassFormInBoxBold[Gbl.Prefs.Theme],
NULL);
HTM_BUTTON_Animated_Begin (Txt_Calculate_average_photo_of_THE_DEGREE_X,
The_ClassFormLinkInBoxBold[Gbl.Prefs.Theme],
NULL);
Ico_PutCalculateIconWithText (Txt_Calculate_average_photo_of_THE_DEGREE_X);
Frm_LinkFormEnd ();
HTM_BUTTON_End ();
/* Selector with all the degrees with students */
HTM_SELECT_Begin (false,

View File

@ -792,16 +792,16 @@ static void Prf_EndListItem (void)
static void Prf_PutLinkCalculateFigures (const char *EncryptedUsrCod)
{
extern const char *The_ClassFormOutBoxBold[The_NUM_THEMES];
extern const char *The_ClassFormLinkOutBoxBold[The_NUM_THEMES];
extern const char *Txt_Calculate;
Frm_StartForm (ActCalFig);
Usr_PutParamUsrCodEncrypted (EncryptedUsrCod);
Frm_LinkFormSubmitAnimated (Txt_Calculate,
The_ClassFormOutBoxBold[Gbl.Prefs.Theme],
NULL);
HTM_BUTTON_Animated_Begin (Txt_Calculate,
The_ClassFormLinkOutBoxBold[Gbl.Prefs.Theme],
NULL);
Ico_PutCalculateIconWithText (Txt_Calculate);
Frm_LinkFormEnd ();
HTM_BUTTON_End ();
Frm_EndForm ();
}

View File

@ -1770,13 +1770,18 @@ static void TL_WriteAuthorNote (const struct UsrData *UsrDat)
HTM_BUTTON_End ();
Frm_EndForm ();
/***** Separator *****/
HTM_SPAN_Begin ("class=\"DAT_LIGHT\"");
HTM_NBSP ();
HTM_SPAN_End ();
/***** Show user's nickname inside form to go to user's public profile *****/
Frm_StartFormUnique (ActSeeOthPubPrf);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
HTM_BUTTON_Begin (ItsMe ? Txt_My_public_profile :
Txt_Another_user_s_profile,
"BT_LINK DAT_LIGHT",NULL);
HTM_TxtF (" @%s",UsrDat->Nickname);
HTM_TxtF ("@%s",UsrDat->Nickname);
HTM_BUTTON_End ();
Frm_EndForm ();
@ -2345,7 +2350,7 @@ static void TL_PutFormToWriteNewPost (void)
HTM_SPAN_End ();
HTM_SPAN_Begin ("class=\"DAT_LIGHT\"");
HTM_TxtF (" @%s",Gbl.Usrs.Me.UsrDat.Nickname);
HTM_TxtF ("&nbsp;@%s",Gbl.Usrs.Me.UsrDat.Nickname);
HTM_SPAN_End ();
HTM_DIV_End ();
@ -3086,13 +3091,18 @@ static void TL_WriteAuthorComment (struct UsrData *UsrDat)
HTM_BUTTON_End ();
Frm_EndForm ();
/***** Separator *****/
HTM_SPAN_Begin ("class=\"DAT_LIGHT\"");
HTM_NBSP ();
HTM_SPAN_End ();
/***** Show user's nickname inside form to go to user's public profile *****/
Frm_StartFormUnique (ActSeeOthPubPrf);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
HTM_BUTTON_Begin (ItsMe ? Txt_My_public_profile :
Txt_Another_user_s_profile,
"BT_LINK DAT_LIGHT",NULL);
HTM_TxtF (" @%s",UsrDat->Nickname);
HTM_TxtF ("@%s",UsrDat->Nickname);
HTM_BUTTON_End ();
Frm_EndForm ();