Version19.42.5

This commit is contained in:
Antonio Cañas Vargas 2019-10-24 09:46:20 +02:00
parent 6f2c3cf3a4
commit 0d7b5b1070
23 changed files with 209 additions and 251 deletions

View File

@ -115,12 +115,12 @@ void Acc_ShowFormMyAccount (void)
Acc_ShowFormChgMyAccount (); Acc_ShowFormChgMyAccount ();
else // Not logged else // Not logged
{ {
/***** Links to other actions *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Usr_PutLinkToLogin (); Usr_PutLinkToLogin ();
Pwd_PutLinkToSendNewPasswd (); Pwd_PutLinkToSendNewPasswd ();
Lan_PutLinkToChangeLanguage (); Lan_PutLinkToChangeLanguage ();
HTM_DIV_End (); Mnu_ContextMenuEnd ();
/**** Show form to check if I have an account *****/ /**** Show form to check if I have an account *****/
Acc_ShowFormCheckIfIHaveAccount (Txt_Before_creating_a_new_account_check_if_you_have_been_already_registered); Acc_ShowFormCheckIfIHaveAccount (Txt_Before_creating_a_new_account_check_if_you_have_been_already_registered);
@ -188,12 +188,12 @@ void Acc_CheckIfEmptyAccountExists (void)
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
/***** Links to other actions *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Usr_PutLinkToLogin (); Usr_PutLinkToLogin ();
Pwd_PutLinkToSendNewPasswd (); Pwd_PutLinkToSendNewPasswd ();
Lan_PutLinkToChangeLanguage (); Lan_PutLinkToChangeLanguage ();
HTM_DIV_End (); Mnu_ContextMenuEnd ();
/***** Get new user's ID from form *****/ /***** Get new user's ID from form *****/
Par_GetParToText ("ID",ID,ID_MAX_BYTES_USR_ID); Par_GetParToText ("ID",ID,ID_MAX_BYTES_USR_ID);
@ -324,12 +324,12 @@ static void Acc_WriteRowEmptyAccount (unsigned NumUsr,const char *ID,struct UsrD
void Acc_ShowFormCreateMyAccount (void) void Acc_ShowFormCreateMyAccount (void)
{ {
/***** Links to other actions *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Usr_PutLinkToLogin (); Usr_PutLinkToLogin ();
Pwd_PutLinkToSendNewPasswd (); Pwd_PutLinkToSendNewPasswd ();
Lan_PutLinkToChangeLanguage (); Lan_PutLinkToChangeLanguage ();
HTM_DIV_End (); Mnu_ContextMenuEnd ();
/**** Show form to create a new account *****/ /**** Show form to create a new account *****/
Acc_ShowFormRequestNewAccountWithParams ("",""); Acc_ShowFormRequestNewAccountWithParams ("","");

View File

@ -166,22 +166,24 @@ void Att_SeeAttEvents (void)
/***** Get list of attendance events *****/ /***** Get list of attendance events *****/
Att_GetListAttEvents (Att_NEWEST_FIRST); Att_GetListAttEvents (Att_NEWEST_FIRST);
/***** Put link to show list of attendance *****/ /***** Contextual menu *****/
if (Gbl.AttEvents.Num && if (Gbl.AttEvents.Num &&
Gbl.Usrs.Me.UsrDat.Nickname[0]) Gbl.Usrs.Me.UsrDat.Nickname[0])
switch (Gbl.Usrs.Me.Role.Logged) switch (Gbl.Usrs.Me.Role.Logged)
{ {
case Rol_STD: case Rol_STD:
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /* List my attendance */
Mnu_ContextMenuBegin ();
Att_PutFormToListMyAttendance (); Att_PutFormToListMyAttendance ();
HTM_DIV_End (); Mnu_ContextMenuEnd ();
break; break;
case Rol_NET: case Rol_NET:
case Rol_TCH: case Rol_TCH:
case Rol_SYS_ADM: case Rol_SYS_ADM:
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /* List students' attendance */
Mnu_ContextMenuBegin ();
Att_PutFormToListStdsAttendance (); Att_PutFormToListStdsAttendance ();
HTM_DIV_End (); Mnu_ContextMenuEnd ();
break; break;
default: default:
break; break;

View File

@ -487,7 +487,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.42.4 (2019-10-23)" #define Log_PLATFORM_VERSION "SWAD 19.42.5 (2019-10-24)"
#define CSS_FILE "swad19.41.3.css" #define CSS_FILE "swad19.41.3.css"
#define JS_FILE "swad19.39.js" #define JS_FILE "swad19.39.js"
/* /*
@ -495,6 +495,7 @@ ps2pdf source.ps destination.pdf
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.) // TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
// TODO: Change icon to upload file in timeline to photo-video.svg // TODO: Change icon to upload file in timeline to photo-video.svg
Version 19.42.5: Oct 24, 2019 Code refactoring in contextual menus. (246011 lines)
Version 19.42.4: Oct 23, 2019 Code refactoring in HTML divs. (246016 lines) Version 19.42.4: Oct 23, 2019 Code refactoring in HTML divs. (246016 lines)
Version 19.42.3: Oct 23, 2019 Code refactoring in HTML divs. (246052 lines) Version 19.42.3: Oct 23, 2019 Code refactoring in HTML divs. (246052 lines)
Version 19.42.2: Oct 23, 2019 Code refactoring in HTML divs. (246025 lines) Version 19.42.2: Oct 23, 2019 Code refactoring in HTML divs. (246025 lines)

View File

@ -83,12 +83,12 @@ void Con_ShowConnectedUsrs (void)
extern const char *Hlp_USERS_Connected; extern const char *Hlp_USERS_Connected;
extern const char *Txt_Connected_users; extern const char *Txt_Connected_users;
/***** Link to show last clicks in real time *****/ /***** Contextual menu *****/
if (Gbl.Usrs.Me.Logged) if (Gbl.Usrs.Me.Logged)
{ {
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Sta_PutLinkToLastClicks (); Sta_PutLinkToLastClicks (); // Show last clicks in real time
HTM_DIV_End (); Mnu_ContextMenuEnd ();
} }
/***** Get scope *****/ /***** Get scope *****/

View File

@ -197,18 +197,15 @@ static void Crs_Configuration (bool PrintView)
if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected
return; return;
/***** Messages and links above the box *****/ /***** Contextual menu *****/
if (!PrintView) if (!PrintView)
{
/* Link to request enrolment in the current course */
if (Gbl.Usrs.Me.Role.Logged == Rol_GST || if (Gbl.Usrs.Me.Role.Logged == Rol_GST ||
Gbl.Usrs.Me.Role.Logged == Rol_USR) Gbl.Usrs.Me.Role.Logged == Rol_USR)
{ {
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Enr_PutLinkToRequestSignUp (); Enr_PutLinkToRequestSignUp (); // Request enrolment in the current course
HTM_DIV_End (); Mnu_ContextMenuEnd ();
} }
}
/***** Start box *****/ /***** Start box *****/
if (PrintView) if (PrintView)

View File

@ -667,10 +667,10 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
Act_Action_t NextAction; Act_Action_t NextAction;
const char *Title; const char *Title;
/***** Put contextual links *****/ /***** Contextual menu *****/
if (Gbl.Hierarchy.Level == Hie_CRS) // Course selected if (Gbl.Hierarchy.Level == Hie_CRS) // Course selected
{ {
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
switch (Role) switch (Role)
{ {
@ -697,7 +697,7 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
break; break;
} }
HTM_DIV_End (); Mnu_ContextMenuEnd ();
} }
/***** Form to send students to be enroled / removed *****/ /***** Form to send students to be enroled / removed *****/
@ -3083,15 +3083,12 @@ void Enr_ReqRegRemOth (void)
void Enr_ReqRegRemStd (void) void Enr_ReqRegRemStd (void)
{ {
/***** Contextual menu *****/
if (Enr_ICanAdminOtherUsrs[Gbl.Usrs.Me.Role.Logged]) if (Enr_ICanAdminOtherUsrs[Gbl.Usrs.Me.Role.Logged])
{ {
/***** Put contextual links *****/ Mnu_ContextMenuBegin ();
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Enr_PutLinkToAdminSeveralUsrs (Rol_STD); // Admin several students
Mnu_ContextMenuEnd ();
/* Put link to go to admin several students */
Enr_PutLinkToAdminSeveralUsrs (Rol_STD);
HTM_DIV_End ();
} }
/***** Form to request user to be administered *****/ /***** Form to request user to be administered *****/

View File

@ -3767,26 +3767,21 @@ static void Brw_WriteTopBeforeShowingFileBrowser (void)
/***** Update last access to this file browser *****/ /***** Update last access to this file browser *****/
Brw_UpdateLastAccess (); Brw_UpdateLastAccess ();
/***** Write contextual links *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Brw_PutCheckboxFullTree (); // Checkbox to show the full tree
/* Put checkbox to show the full tree */
Brw_PutCheckboxFullTree ();
if (Brw_GetIfBriefcaseFileBrowser ()) if (Brw_GetIfBriefcaseFileBrowser ())
{ {
/* Put link to remove old files */
if (Gbl.Action.Act != ActReqRemOldBrf) if (Gbl.Action.Act != ActReqRemOldBrf)
Brw_PutLinkToAskRemOldFiles (); Brw_PutLinkToAskRemOldFiles (); // Remove old files
} }
else if (Brw_GetIfCrsAssigWorksFileBrowser ()) else if (Brw_GetIfCrsAssigWorksFileBrowser ())
{ {
/* Put link to create a zip file with all the works of the selected users */
if (!Gbl.FileBrowser.ZIP.CreateZIP) if (!Gbl.FileBrowser.ZIP.CreateZIP)
ZIP_PutLinkToCreateZIPAsgWrk (); ZIP_PutLinkToCreateZIPAsgWrk (); // Create a zip file with the
// works of the selected users
} }
Mnu_ContextMenuEnd ();
HTM_DIV_End ();
/***** Initialize hidden levels *****/ /***** Initialize hidden levels *****/
switch (Gbl.FileBrowser.Type) switch (Gbl.FileBrowser.Type)

View File

@ -134,11 +134,11 @@ void Fol_SuggestUsrsToFollowMainZone (void)
unsigned long NumUsr; unsigned long NumUsr;
struct UsrData UsrDat; struct UsrData UsrDat;
/***** Put links to request my public profile and another user's profile *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Prf_PutLinkMyPublicProfile (); Prf_PutLinkMyPublicProfile (); // My public profile
Prf_PutLinkRequestAnotherUserProfile (); Prf_PutLinkRequestAnotherUserProfile (); // Request another user's profile
HTM_DIV_End (); Mnu_ContextMenuEnd ();
/***** Get users *****/ /***** Get users *****/
if ((NumUsrs = Fol_GetUsrsToFollow (Fol_MAX_USRS_TO_FOLLOW_MAIN_ZONE, if ((NumUsrs = Fol_GetUsrsToFollow (Fol_MAX_USRS_TO_FOLLOW_MAIN_ZONE,

View File

@ -64,13 +64,10 @@ extern struct Globals Gbl;
void Hie_SeePending (void) void Hie_SeePending (void)
{ {
/***** Put contextual links *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Crs_PutLinkToRemoveOldCrss (); // Remove old courses
/* Put link to remove old courses */ Mnu_ContextMenuEnd ();
Crs_PutLinkToRemoveOldCrss ();
HTM_DIV_End ();
/***** List countries with pending institutions *****/ /***** List countries with pending institutions *****/
Cty_SeeCtyWithPendingInss (); Cty_SeeCtyWithPendingInss ();

View File

@ -381,24 +381,27 @@ void Inf_ShowInfo (void)
switch (Gbl.Usrs.Me.Role.Logged) switch (Gbl.Usrs.Me.Role.Logged)
{ {
case Rol_STD: case Rol_STD:
/* Put checkbox to force students to read this couse info */
if (MustBeRead) if (MustBeRead)
{ {
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Inf_PutCheckboxConfirmIHaveReadInfo (); Mnu_ContextMenuBegin ();
HTM_DIV_End (); Inf_PutCheckboxConfirmIHaveReadInfo (); // Checkbox to confirm that...
// ...I have read this couse info
Mnu_ContextMenuEnd ();
} }
break; break;
case Rol_NET: case Rol_NET:
case Rol_TCH: case Rol_TCH:
case Rol_SYS_ADM: case Rol_SYS_ADM:
/* Put checkbox to force students to read this couse info */ /* Put */
if (InfoSrc != Inf_INFO_SRC_NONE) if (InfoSrc != Inf_INFO_SRC_NONE)
{ {
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Mnu_ContextMenuBegin ();
Disabled = (Gbl.Usrs.Me.Role.Logged == Rol_NET); // Non-editing teachers can not change the status of checkbox Disabled = (Gbl.Usrs.Me.Role.Logged == Rol_NET); // Non-editing teachers can not change the status of checkbox
Inf_PutCheckboxForceStdsToReadInfo (MustBeRead,Disabled); Inf_PutCheckboxForceStdsToReadInfo (MustBeRead,Disabled); // Checkbox to force students...
HTM_DIV_End (); // ...to read this couse info
Mnu_ContextMenuEnd ();
} }
break; break;
default: default:

View File

@ -988,8 +988,10 @@ static void Mai_ListEmails (void)
NumAcceptedUsrsWithEmail); NumAcceptedUsrsWithEmail);
HTM_DIV_End (); HTM_DIV_End ();
/***** Icon to open the client email program *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
/* Open the client email program */
fprintf (Gbl.F.Out,"<a href=\"mailto:%s?subject=%s&cc=%s&bcc=%s\"" fprintf (Gbl.F.Out,"<a href=\"mailto:%s?subject=%s&cc=%s&bcc=%s\""
" title=\"%s\" class=\"%s\">", " title=\"%s\" class=\"%s\">",
Gbl.Usrs.Me.UsrDat.Email, Gbl.Usrs.Me.UsrDat.Email,
@ -1001,7 +1003,8 @@ static void Mai_ListEmails (void)
Ico_PutIconTextLink ("marker.svg", Ico_PutIconTextLink ("marker.svg",
Txt_Create_email_message); Txt_Create_email_message);
fprintf (Gbl.F.Out,"</a>"); fprintf (Gbl.F.Out,"</a>");
HTM_DIV_End ();
Mnu_ContextMenuEnd ();
/***** End the box used to list the emails *****/ /***** End the box used to list the emails *****/
Box_EndBox (); Box_EndBox ();

View File

@ -93,11 +93,12 @@ void McR_PutFormToViewMchResults (Act_Action_t Action)
{ {
extern const char *Txt_Results; extern const char *Txt_Results;
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Mnu_ContextMenuBegin ();
Lay_PutContextualLinkIconText (Action,NULL,NULL, Lay_PutContextualLinkIconText (Action,NULL,NULL,
"tasks.svg", "tasks.svg",
Txt_Results); Txt_Results); // View match results
HTM_DIV_End (); Mnu_ContextMenuEnd ();
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -485,3 +485,17 @@ Mnu_Menu_t Mnu_GetMenuFromStr (const char *Str)
return Mnu_MENU_DEFAULT; return Mnu_MENU_DEFAULT;
} }
/*****************************************************************************/
/******************************** Context menu *******************************/
/*****************************************************************************/
void Mnu_ContextMenuBegin (void)
{
HTM_DIV_Begin ("class=\"CONTEXT_MENU\"");
}
void Mnu_ContextMenuEnd (void)
{
HTM_DIV_End ();
}

View File

@ -57,4 +57,7 @@ void Mnu_ChangeMenu (void);
Mnu_Menu_t Mnu_GetParamMenu (void); Mnu_Menu_t Mnu_GetParamMenu (void);
Mnu_Menu_t Mnu_GetMenuFromStr (const char *Str); Mnu_Menu_t Mnu_GetMenuFromStr (const char *Str);
void Mnu_ContextMenuBegin (void);
void Mnu_ContextMenuEnd (void);
#endif #endif

View File

@ -364,13 +364,14 @@ static void Msg_PutLinkToShowMorePotentialRecipients (void)
{ {
extern const char *Txt_Show_more_recipients; extern const char *Txt_Show_more_recipients;
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Mnu_ContextMenuBegin ();
Lay_PutContextualLinkIconTextOnSubmit (ActReqMsgUsr,NULL, Lay_PutContextualLinkIconTextOnSubmit (ActReqMsgUsr,NULL,
Msg_PutParamsShowMorePotentialRecipients, Msg_PutParamsShowMorePotentialRecipients,
"users.svg", "users.svg",
Txt_Show_more_recipients, Txt_Show_more_recipients,
"CopyMessageToHiddenFields();"); "CopyMessageToHiddenFields();"); // Shor more potential recipients
HTM_DIV_End (); Mnu_ContextMenuEnd ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1662,12 +1663,12 @@ void Msg_ShowSntMsgs (void)
void Msg_ShowRecMsgs (void) void Msg_ShowRecMsgs (void)
{ {
/***** Link to view banned users *****/
if (Msg_GetNumUsrsBannedByMe ()) if (Msg_GetNumUsrsBannedByMe ())
{ {
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Msg_PutLinkToViewBannedUsers (); Mnu_ContextMenuBegin ();
HTM_DIV_End (); Msg_PutLinkToViewBannedUsers (); // View banned users
Mnu_ContextMenuEnd ();
} }
/***** Show the received messages *****/ /***** Show the received messages *****/
@ -1766,12 +1767,13 @@ static void Msg_ShowSentOrReceivedMessages (void)
HTM_DIV_End (); HTM_DIV_End ();
Msg_ShowFormToFilterMsgs (); Msg_ShowFormToFilterMsgs ();
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Mnu_ContextMenuBegin ();
Frm_LinkFormSubmitAnimated (Txt_Update_messages, Frm_LinkFormSubmitAnimated (Txt_Update_messages,
The_ClassFormInBoxBold[Gbl.Prefs.Theme], The_ClassFormInBoxBold[Gbl.Prefs.Theme],
NULL); NULL);
Ico_PutCalculateIconWithText (Txt_Update_messages); Ico_PutCalculateIconWithText (Txt_Update_messages); // Animated icon to update messages
HTM_DIV_End (); Mnu_ContextMenuEnd ();
Frm_EndForm (); Frm_EndForm ();

View File

@ -358,29 +358,20 @@ void Ntf_ShowMyNotifications (void)
" ORDER BY TimeNotif DESC", " ORDER BY TimeNotif DESC",
Gbl.Usrs.Me.UsrDat.UsrCod,SubQuery); Gbl.Usrs.Me.UsrDat.UsrCod,SubQuery);
/***** Contextual links *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Ntf_WriteFormAllNotifications (AllNotifications); // Show all notifications
/* Write form to show all notifications */
Ntf_WriteFormAllNotifications (AllNotifications);
if (NumNotifications) // TODO: Show message only when I don't have notificacions at all if (NumNotifications) // TODO: Show message only when I don't have notificacions at all
/* Put form to change notification settings */
Lay_PutContextualLinkIconText (ActMrkNtfSee,NULL,NULL, Lay_PutContextualLinkIconText (ActMrkNtfSee,NULL,NULL,
"eye.svg", "eye.svg",
Txt_Mark_all_NOTIFICATIONS_as_read); Txt_Mark_all_NOTIFICATIONS_as_read); // Mark notifications as read
/* Put form to change notification settings */
Lay_PutContextualLinkIconText (ActReqEdiSet,Ntf_NOTIFICATIONS_ID,NULL, Lay_PutContextualLinkIconText (ActReqEdiSet,Ntf_NOTIFICATIONS_ID,NULL,
"cog.svg", "cog.svg",
Txt_Settings); Txt_Settings); // Change notification settings
/* Put form to view allowed mail domains */
Lay_PutContextualLinkIconText (ActSeeMai,NULL,NULL, Lay_PutContextualLinkIconText (ActSeeMai,NULL,NULL,
"envelope.svg", "envelope.svg",
Txt_Domains); Txt_Domains); // View allowed mail domains
Mnu_ContextMenuEnd ();
HTM_DIV_End ();
/***** Start box *****/ /***** Start box *****/
Box_StartBox (NULL,Txt_Notifications,Ntf_PutIconsNotif, Box_StartBox (NULL,Txt_Notifications,Ntf_PutIconsNotif,

View File

@ -2010,10 +2010,10 @@ static void Pho_PutLinkToCalculateDegreeStats (void)
/***** Get data of the degree from database *****/ /***** Get data of the degree from database *****/
Deg_GetDataOfDegreeByCod (&Deg); Deg_GetDataOfDegreeByCod (&Deg);
/***** Start div *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
/***** Begin form *****/ /* Begin form */
Frm_StartForm (ActCalPhoDeg); Frm_StartForm (ActCalPhoDeg);
Pho_PutHiddenParamTypeOfAvg (); Pho_PutHiddenParamTypeOfAvg ();
Pho_PutHiddenParamPhotoSize (); Pho_PutHiddenParamPhotoSize ();
@ -2024,7 +2024,7 @@ static void Pho_PutLinkToCalculateDegreeStats (void)
NULL); NULL);
Ico_PutCalculateIconWithText (Txt_Calculate_average_photo_of_THE_DEGREE_X); Ico_PutCalculateIconWithText (Txt_Calculate_average_photo_of_THE_DEGREE_X);
/***** Put selector with all the degrees with students *****/ /* Selector with all the degrees with students */
fprintf (Gbl.F.Out,"<select name=\"OthDegCod\">"); fprintf (Gbl.F.Out,"<select name=\"OthDegCod\">");
for (NumDeg = 0; for (NumDeg = 0;
NumDeg < Degs.Num; NumDeg < Degs.Num;
@ -2049,11 +2049,11 @@ static void Pho_PutLinkToCalculateDegreeStats (void)
Txt_time, Txt_time,
StrEstimatedTimeToComputeAvgPhoto); StrEstimatedTimeToComputeAvgPhoto);
} }
/***** End selector, form and div *****/
fprintf (Gbl.F.Out,"</select>"); fprintf (Gbl.F.Out,"</select>");
/* End form and contextual menu */
Frm_EndForm (); Frm_EndForm ();
HTM_DIV_End (); Mnu_ContextMenuEnd ();
/***** Free list of all the degrees with students *****/ /***** Free list of all the degrees with students *****/
Deg_FreeListDegs (&Degs); Deg_FreeListDegs (&Degs);

View File

@ -187,11 +187,11 @@ void Prf_RequestUserProfile (void)
if (Gbl.Usrs.Me.Logged) if (Gbl.Usrs.Me.Logged)
{ {
/***** Put link to show my public profile and users to follow *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Prf_PutLinkMyPublicProfile (); Prf_PutLinkMyPublicProfile (); // My public profile
Fol_PutLinkWhoToFollow (); Fol_PutLinkWhoToFollow (); // Users to follow
HTM_DIV_End (); Mnu_ContextMenuEnd ();
} }
/***** Begin form *****/ /***** Begin form *****/
@ -285,22 +285,16 @@ bool Prf_ShowUserProfile (struct UsrData *UsrDat)
/***** Check if I can see the public profile *****/ /***** Check if I can see the public profile *****/
if (Pri_ShowingIsAllowed (UsrDat->BaPrfVisibility,UsrDat)) if (Pri_ShowingIsAllowed (UsrDat->BaPrfVisibility,UsrDat))
{ {
/***** Contextual links *****/
if (Gbl.Usrs.Me.Logged) if (Gbl.Usrs.Me.Logged)
{ {
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Mnu_ContextMenuBegin ();
if (ItsMe) if (ItsMe)
/* Put link to show another user's profile */ Prf_PutLinkRequestAnotherUserProfile (); // Request another user's profile
Prf_PutLinkRequestAnotherUserProfile ();
else // Not me else // Not me
/* Put link to show my public profile */ Prf_PutLinkMyPublicProfile (); // My public profile
Prf_PutLinkMyPublicProfile (); Fol_PutLinkWhoToFollow (); // Users to follow
Mnu_ContextMenuEnd ();
/* Put link to show users to follow */
Fol_PutLinkWhoToFollow ();
HTM_DIV_End ();
} }
/***** Shared record card *****/ /***** Shared record card *****/

View File

@ -976,15 +976,16 @@ static void Rec_ListRecordsGsts (Rec_SharedRecordViewType_t TypeOfView)
if (TypeOfView == Rec_SHA_RECORD_LIST) // Listing several records if (TypeOfView == Rec_SHA_RECORD_LIST) // Listing several records
{ {
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Mnu_ContextMenuBegin ();
/* Link to print view */ /* Print view */
Frm_StartForm (ActPrnRecSevGst); Frm_StartForm (ActPrnRecSevGst);
Usr_PutHiddenParSelectedUsrsCods (); Usr_PutHiddenParSelectedUsrsCods ();
Rec_ShowLinkToPrintPreviewOfRecords (); Rec_ShowLinkToPrintPreviewOfRecords ();
Frm_EndForm (); Frm_EndForm ();
HTM_DIV_End (); Mnu_ContextMenuEnd ();
} }
/***** Initialize structure with user's data *****/ /***** Initialize structure with user's data *****/
@ -1070,14 +1071,14 @@ static void Rec_ShowRecordOneStdCrs (void)
/***** Get list of fields of records in current course *****/ /***** Get list of fields of records in current course *****/
Rec_GetListRecordFieldsInCurrentCrs (); Rec_GetListRecordFieldsInCurrentCrs ();
/***** Put contextual links *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
/* Link to edit record fields */ /* Edit record fields */
if (Gbl.Usrs.Me.Role.Logged == Rol_TCH) if (Gbl.Usrs.Me.Role.Logged == Rol_TCH)
Rec_PutLinkToEditRecordFields (); Rec_PutLinkToEditRecordFields ();
/* Link to print view */ /* Print view */
Frm_StartForm (ActPrnRecSevStd); Frm_StartForm (ActPrnRecSevStd);
Usr_CreateListSelectedUsrsCodsAndFillWithOtherUsr (); Usr_CreateListSelectedUsrsCodsAndFillWithOtherUsr ();
Usr_PutHiddenParSelectedUsrsCods (); Usr_PutHiddenParSelectedUsrsCods ();
@ -1085,7 +1086,7 @@ static void Rec_ShowRecordOneStdCrs (void)
Rec_ShowLinkToPrintPreviewOfRecords (); Rec_ShowLinkToPrintPreviewOfRecords ();
Frm_EndForm (); Frm_EndForm ();
HTM_DIV_End (); Mnu_ContextMenuEnd ();
/***** Show optional alert (result of editing data in course record) *****/ /***** Show optional alert (result of editing data in course record) *****/
Ale_ShowAlerts (NULL); Ale_ShowAlerts (NULL);
@ -1174,19 +1175,20 @@ static void Rec_ListRecordsStds (Rec_SharedRecordViewType_t ShaTypeOfView,
if (ShaTypeOfView == Rec_SHA_RECORD_LIST) if (ShaTypeOfView == Rec_SHA_RECORD_LIST)
{ {
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Mnu_ContextMenuBegin ();
/* Link to edit record fields */ /* Edit record fields */
if (Gbl.Usrs.Me.Role.Logged == Rol_TCH) if (Gbl.Usrs.Me.Role.Logged == Rol_TCH)
Rec_PutLinkToEditRecordFields (); Rec_PutLinkToEditRecordFields ();
/* Link to print view */ /* Print view */
Frm_StartForm (ActPrnRecSevStd); Frm_StartForm (ActPrnRecSevStd);
Usr_PutHiddenParSelectedUsrsCods (); Usr_PutHiddenParSelectedUsrsCods ();
Rec_ShowLinkToPrintPreviewOfRecords (); Rec_ShowLinkToPrintPreviewOfRecords ();
Frm_EndForm (); Frm_EndForm ();
HTM_DIV_End (); Mnu_ContextMenuEnd ();
} }
/***** Initialize structure with user's data *****/ /***** Initialize structure with user's data *****/
@ -1302,13 +1304,13 @@ static void Rec_ShowRecordOneTchCrs (void)
/***** Get if I want to see teachers' office hours in teachers' records *****/ /***** Get if I want to see teachers' office hours in teachers' records *****/
ShowOfficeHours = Rec_GetParamShowOfficeHours (); ShowOfficeHours = Rec_GetParamShowOfficeHours ();
/***** Show contextual menu *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
/* Show office hours? */ /* Show office hours? */
Rec_WriteFormShowOfficeHoursOneTch (ShowOfficeHours); Rec_WriteFormShowOfficeHoursOneTch (ShowOfficeHours);
/* Link to print view */ /* Print view */
Frm_StartForm (ActPrnRecSevTch); Frm_StartForm (ActPrnRecSevTch);
Usr_CreateListSelectedUsrsCodsAndFillWithOtherUsr (); Usr_CreateListSelectedUsrsCodsAndFillWithOtherUsr ();
Usr_PutHiddenParSelectedUsrsCods (); Usr_PutHiddenParSelectedUsrsCods ();
@ -1319,7 +1321,7 @@ static void Rec_ShowRecordOneTchCrs (void)
Rec_ShowLinkToPrintPreviewOfRecords (); Rec_ShowLinkToPrintPreviewOfRecords ();
Frm_EndForm (); Frm_EndForm ();
HTM_DIV_End (); Mnu_ContextMenuEnd ();
/***** Start container for this user *****/ /***** Start container for this user *****/
HTM_DIV_Begin ("class=\"REC_USR\""); HTM_DIV_Begin ("class=\"REC_USR\"");
@ -1392,13 +1394,13 @@ static void Rec_ListRecordsTchs (Rec_SharedRecordViewType_t TypeOfView)
if (Gbl.Action.Act == ActSeeRecSevTch) if (Gbl.Action.Act == ActSeeRecSevTch)
{ {
/***** Show contextual menu *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
/* Show office hours? */ /* Show office hours? */
Rec_WriteFormShowOfficeHoursSeveralTchs (ShowOfficeHours); Rec_WriteFormShowOfficeHoursSeveralTchs (ShowOfficeHours);
/* Link to print view */ /* Print view */
Frm_StartForm (ActPrnRecSevTch); Frm_StartForm (ActPrnRecSevTch);
Usr_PutHiddenParSelectedUsrsCods (); Usr_PutHiddenParSelectedUsrsCods ();
Par_PutHiddenParamChar ("ParamOfficeHours",'Y'); Par_PutHiddenParamChar ("ParamOfficeHours",'Y');
@ -1408,7 +1410,7 @@ static void Rec_ListRecordsTchs (Rec_SharedRecordViewType_t TypeOfView)
Rec_ShowLinkToPrintPreviewOfRecords (); Rec_ShowLinkToPrintPreviewOfRecords ();
Frm_EndForm (); Frm_EndForm ();
HTM_DIV_End (); Mnu_ContextMenuEnd ();
} }
/***** Initialize structure with user's data *****/ /***** Initialize structure with user's data *****/

View File

@ -315,16 +315,11 @@ void Sta_AskShowCrsHits (void)
Sta_ClicksGroupedBy_t ClicksGroupedBy; Sta_ClicksGroupedBy_t ClicksGroupedBy;
unsigned long i; unsigned long i;
/***** Contextual links *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Sta_PutLinkToGlobalHits (); // Global hits
/* Put form to go to test edition and configuration */ Sta_PutLinkToLastClicks (); // Last clicks in real time
Sta_PutLinkToGlobalHits (); Mnu_ContextMenuEnd ();
/* Link to show last clicks in real time */
Sta_PutLinkToLastClicks ();
HTM_DIV_End ();
/***** Get and update type of list, /***** Get and update type of list,
number of columns in class photo number of columns in class photo
@ -522,16 +517,11 @@ void Sta_AskShowGblHits (void)
Sta_Role_t RoleStat; Sta_Role_t RoleStat;
Sta_ClicksGroupedBy_t ClicksGroupedBy; Sta_ClicksGroupedBy_t ClicksGroupedBy;
/***** Contextual links *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Sta_PutLinkToCourseHits (); // Course hits
/* Put form to go to test edition and configuration */ Sta_PutLinkToLastClicks (); // Last clicks in real time
Sta_PutLinkToCourseHits (); Mnu_ContextMenuEnd ();
/* Link to show last clicks in real time */
Sta_PutLinkToLastClicks ();
HTM_DIV_End ();
/***** Begin form *****/ /***** Begin form *****/
Frm_StartFormAnchor (ActSeeAccGbl,Sta_STAT_RESULTS_SECTION_ID); Frm_StartFormAnchor (ActSeeAccGbl,Sta_STAT_RESULTS_SECTION_ID);
@ -3994,16 +3984,11 @@ void Sta_ShowLastClicks (void)
extern const char *Hlp_USERS_Connected_last_clicks; extern const char *Hlp_USERS_Connected_last_clicks;
extern const char *Txt_Last_clicks_in_real_time; extern const char *Txt_Last_clicks_in_real_time;
/***** Contextual links *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Sta_PutLinkToGlobalHits (); // Global hits
/* Put form to go to test edition and configuration */ Sta_PutLinkToCourseHits (); // Course hits
Sta_PutLinkToGlobalHits (); Mnu_ContextMenuEnd ();
/* Put form to go to test edition and configuration */
Sta_PutLinkToCourseHits ();
HTM_DIV_End ();
/***** Start box *****/ /***** Start box *****/
Box_StartBox (NULL,Txt_Last_clicks_in_real_time,NULL, Box_StartBox (NULL,Txt_Last_clicks_in_real_time,NULL,

View File

@ -405,11 +405,12 @@ static void Tst_PutFormToViewTstResults (Act_Action_t Action)
{ {
extern const char *Txt_Results; extern const char *Txt_Results;
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Mnu_ContextMenuBegin ();
Lay_PutContextualLinkIconText (Action,NULL,NULL, Lay_PutContextualLinkIconText (Action,NULL,NULL,
"tasks.svg", "tasks.svg",
Txt_Results); Txt_Results); // Tests results
HTM_DIV_End (); Mnu_ContextMenuEnd ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1285,9 +1286,9 @@ void Tst_ShowFormAskEditTsts (void)
unsigned long NumRows; unsigned long NumRows;
/***** Contextual menu *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
TsI_PutFormToImportQuestions (); // Put link (form) to import questions from XML file TsI_PutFormToImportQuestions (); // Import questions from XML file
HTM_DIV_End (); Mnu_ContextMenuEnd ();
/***** Start box *****/ /***** Start box *****/
Box_StartBox (NULL,Txt_List_edit_questions,Tst_PutIconsTests, Box_StartBox (NULL,Txt_List_edit_questions,Tst_PutIconsTests,
@ -2403,16 +2404,14 @@ void Tst_ListQuestionsToEdit (void)
{ {
if ((NumRows = Tst_GetQuestions (&mysql_res)) != 0) // Query database if ((NumRows = Tst_GetQuestions (&mysql_res)) != 0) // Query database
{ {
/* Buttons for edition */ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
if (Gbl.Test.XML.CreateXML) if (Gbl.Test.XML.CreateXML)
/* Create XML file for exporting questions TsI_CreateXML (NumRows,mysql_res); // Create XML file with exported questions...
and put a link to download it */ // ...and put a link to download it
TsI_CreateXML (NumRows,mysql_res);
else else
/* Button to export questions */ TsI_PutFormToExportQuestions (); // Export questions
TsI_PutFormToExportQuestions (); Mnu_ContextMenuEnd ();
HTM_DIV_End ();
/* Show the table with the questions */ /* Show the table with the questions */
Tst_ListOneOrMoreQuestionsForEdition (NumRows,mysql_res); Tst_ListOneOrMoreQuestionsForEdition (NumRows,mysql_res);

View File

@ -1287,10 +1287,10 @@ static void TL_ShowWarningYouDontFollowAnyUser (void)
/***** Show warning if I do not follow anyone *****/ /***** Show warning if I do not follow anyone *****/
Ale_ShowAlert (Ale_WARNING,Txt_You_dont_follow_any_user); Ale_ShowAlert (Ale_WARNING,Txt_You_dont_follow_any_user);
/***** Put link to show users to follow *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Fol_PutLinkWhoToFollow (); Fol_PutLinkWhoToFollow (); // Users to follow
HTM_DIV_End (); Mnu_ContextMenuEnd ();
} }
} }

View File

@ -2587,14 +2587,12 @@ void Usr_WriteFormLogin (Act_Action_t NextAction,void (*FuncParams) (void))
extern const char *Txt_Password; extern const char *Txt_Password;
extern const char *Txt_password; extern const char *Txt_password;
/***** Links to other actions *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Acc_PutLinkToCreateAccount (); // Create account
Acc_PutLinkToCreateAccount (); Pwd_PutLinkToSendNewPasswd (); // Send new password
Pwd_PutLinkToSendNewPasswd (); Lan_PutLinkToChangeLanguage (); // Change language
Lan_PutLinkToChangeLanguage (); Mnu_ContextMenuEnd ();
HTM_DIV_End ();
HTM_DIV_Begin ("class=\"CM\""); HTM_DIV_Begin ("class=\"CM\"");
@ -7296,25 +7294,17 @@ void Usr_ListDataAdms (void)
case Rol_CTR_ADM: case Rol_CTR_ADM:
case Rol_INS_ADM: case Rol_INS_ADM:
case Rol_SYS_ADM: case Rol_SYS_ADM:
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Mnu_ContextMenuBegin ();
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
{ {
/* Put link to remove old users */ Usr_PutLinkToSeeGuests (); // List guests
Usr_PutLinkToSeeGuests (); Dup_PutLinkToListDupUsrs (); // List possible duplicate users
/* Put link to list possible duplicate users */
Dup_PutLinkToListDupUsrs ();
} }
Enr_PutLinkToAdminOneUsr (ActReqMdfOneOth); // Admin one user
/* Put link to go to admin one user */
Enr_PutLinkToAdminOneUsr (ActReqMdfOneOth);
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
/* Put link to remove old users */ Enr_PutLinkToRemOldUsrs (); // Remove old users
Enr_PutLinkToRemOldUsrs (); Mnu_ContextMenuEnd ();
HTM_DIV_End ();
break; break;
default: default:
break; break;
@ -7791,20 +7781,13 @@ void Usr_SeeGuests (void)
bool ICanChooseOption[Usr_LIST_USRS_NUM_OPTIONS]; bool ICanChooseOption[Usr_LIST_USRS_NUM_OPTIONS];
bool PutForm; bool PutForm;
/***** Put contextual links *****/ /***** Contextual menu *****/
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); Mnu_ContextMenuBegin ();
Usr_PutLinkToSeeAdmins (); // List admins
/* Put link to remove old users */ Enr_PutLinkToAdminOneUsr (ActReqMdfOneOth); // Admin one user
Usr_PutLinkToSeeAdmins ();
/* Put link to go to admin one user */
Enr_PutLinkToAdminOneUsr (ActReqMdfOneOth);
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
/* Put link to remove old users */ Enr_PutLinkToRemOldUsrs (); // Remove old users
Enr_PutLinkToRemOldUsrs (); Mnu_ContextMenuEnd ();
HTM_DIV_End ();
/***** Get and update type of list, /***** Get and update type of list,
number of columns in class photo number of columns in class photo
@ -7928,22 +7911,16 @@ void Usr_SeeStudents (void)
case Rol_CTR_ADM: case Rol_CTR_ADM:
case Rol_INS_ADM: case Rol_INS_ADM:
case Rol_SYS_ADM: case Rol_SYS_ADM:
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Mnu_ContextMenuBegin ();
/* Put link to go to admin student */ Enr_PutLinkToAdminOneUsr (ActReqMdfOneStd); // Admin one student
Enr_PutLinkToAdminOneUsr (ActReqMdfOneStd);
if (Gbl.Hierarchy.Level == Hie_CRS && // Course selected if (Gbl.Hierarchy.Level == Hie_CRS && // Course selected
Gbl.Usrs.Me.Role.Logged != Rol_STD) // Teacher or admin Gbl.Usrs.Me.Role.Logged != Rol_STD) // Teacher or admin
{ {
/* Put link to go to admin several students */ Enr_PutLinkToAdminSeveralUsrs (Rol_STD); // Admin several students
Enr_PutLinkToAdminSeveralUsrs (Rol_STD); Rec_PutLinkToEditRecordFields (); // Edit record fields
/* Put link to edit record fields */
Rec_PutLinkToEditRecordFields ();
} }
Mnu_ContextMenuEnd ();
HTM_DIV_End ();
break; break;
default: default:
break; break;
@ -8099,21 +8076,16 @@ void Usr_SeeTeachers (void)
case Rol_CTR_ADM: case Rol_CTR_ADM:
case Rol_INS_ADM: case Rol_INS_ADM:
case Rol_SYS_ADM: case Rol_SYS_ADM:
HTM_DIV_Begin ("class=\"CONTEXT_MENU\""); /***** Contextual menu *****/
Mnu_ContextMenuBegin ();
/* Put link to go to admin one user */ Enr_PutLinkToAdminOneUsr (ActReqMdfOneTch); // Admin one teacher
Enr_PutLinkToAdminOneUsr (ActReqMdfOneTch);
/* Put link to go to admin several users */
if (Gbl.Hierarchy.Level == Hie_CRS && // Course selected if (Gbl.Hierarchy.Level == Hie_CRS && // Course selected
Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM) // I am logged as admin Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM) // I am logged as admin
{ {
Enr_PutLinkToAdminSeveralUsrs (Rol_NET); Enr_PutLinkToAdminSeveralUsrs (Rol_NET); // Admin several non-editing teachers
Enr_PutLinkToAdminSeveralUsrs (Rol_TCH); Enr_PutLinkToAdminSeveralUsrs (Rol_TCH); // Admin several teachers
} }
Mnu_ContextMenuEnd ();
HTM_DIV_End ();
break; break;
default: default:
break; break;