Version 15.6

This commit is contained in:
Antonio Cañas Vargas 2015-10-02 14:30:04 +02:00
parent ea4ea953a2
commit 19eee8c2ac
5 changed files with 37 additions and 10 deletions

View File

@ -4241,7 +4241,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
/*************************** Internal prototypes *****************************/
/*****************************************************************************/
static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,const char *Id);
static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,const char *Id,const char *Anchor);
/*****************************************************************************/
/************* Check if I have permission to execute an action ***************/
@ -4341,31 +4341,43 @@ void Act_FormStart (Act_Action_t NextAction)
{
Gbl.NumForm++; // Initialized to -1. The first time it is incremented, it will be equal to 0
sprintf (Gbl.FormId,"form_%d",Gbl.NumForm);
Act_FormStartInternal (NextAction,true,Gbl.FormId); // Do put now parameter location (if no open session)
Act_FormStartInternal (NextAction,true,Gbl.FormId,NULL); // Do put now parameter location (if no open session)
}
void Act_FormGoToStart (Act_Action_t NextAction)
{
Gbl.NumForm++; // Initialized to -1. The first time it is incremented, it will be equal to 0
sprintf (Gbl.FormId,"form_%d",Gbl.NumForm);
Act_FormStartInternal (NextAction,false,Gbl.FormId); // Do not put now parameter location
Act_FormStartInternal (NextAction,false,Gbl.FormId,NULL); // Do not put now parameter location
}
void Act_FormStartAnchor (Act_Action_t NextAction,const char *Anchor)
{
Gbl.NumForm++; // Initialized to -1. The first time it is incremented, it will be equal to 0
sprintf (Gbl.FormId,"form_%d",Gbl.NumForm);
Act_FormStartInternal (NextAction,true,Gbl.FormId,Anchor); // Do put now parameter location (if no open session)
}
void Act_FormStartId (Act_Action_t NextAction,const char *Id)
{
Gbl.NumForm++; // Initialized to -1. The first time it is incremented, it will be equal to 0
Act_FormStartInternal (NextAction,true,Id); // Do put now parameter location (if no open session)
Act_FormStartInternal (NextAction,true,Id,NULL); // Do put now parameter location (if no open session)
}
// Id can not be NULL
static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,const char *Id)
static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,const char *Id,const char *Anchor)
{
extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES];
if (!Gbl.InsideForm)
{
fprintf (Gbl.F.Out,"<form method=\"post\" action=\"%s/%s\" id=\"%s\"",
Cfg_HTTPS_URL_SWAD_CGI,Txt_STR_LANG_ID[Gbl.Prefs.Language],Id);
fprintf (Gbl.F.Out,"<form method=\"post\" action=\"%s/%s",
Cfg_HTTPS_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language]);
if (Anchor)
if (Anchor[0])
fprintf (Gbl.F.Out,"#%s",Anchor);
fprintf (Gbl.F.Out,"\" id=\"%s\"",Id);
switch (Act_Actions[NextAction].BrowserWindow)
{

View File

@ -1378,6 +1378,7 @@ char *Act_GetActionTextFromDB (long ActCod,char *Txt);
void Act_FormStart (Act_Action_t NextAction);
void Act_FormGoToStart (Act_Action_t NextAction);
void Act_FormStartAnchor (Act_Action_t NextAction,const char *Anchor);
void Act_FormStartId (Act_Action_t NextAction,const char *Id);
void Act_FormEnd (void);
void Act_LinkFormSubmit (const char *Title,const char *LinkStyle);

View File

@ -98,11 +98,12 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.5.2 (2015/10/02)"
#define Log_PLATFORM_VERSION "SWAD 15.6 (2015/10/02)"
// 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 sql/swad*.sql | tail -1
/*
Version 15.6 : Oct 02, 2015 Now a click in a form can go to a part of the destination page. (184959 lines)
Version 15.5.2: Oct 02, 2015 Changes in layout of tests exams. (184934 lines)
Version 15.5.1: Oct 02, 2015 Changes in layout of forms with initial and final dates. (184938 lines)
Version 15.5: Oct 01, 2015 Changes in layout of selectors classphoto/list. (184909 lines)

View File

@ -5201,6 +5201,8 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level,Brw_ExpandTree_
{
extern const char *Txt_Expand_FOLDER_X;
extern const char *Txt_Contract_FOLDER_X;
static unsigned NumAnchor = 0;
char StrAnchor[32];
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
"<table>"
@ -5218,6 +5220,9 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level,Brw_ExpandTree_
break;
case Brw_EXPAND_TREE_PLUS:
/***** Form to expand folder *****/
sprintf (StrAnchor,"folder_%u",++NumAnchor);
fprintf (Gbl.F.Out,"<section id=\"%s\">",StrAnchor);
// Act_FormStartAnchor (Brw_ActExpandFolder[Gbl.FileBrowser.Type],StrAnchor);
Act_FormStart (Brw_ActExpandFolder[Gbl.FileBrowser.Type]);
switch (Gbl.FileBrowser.Type)
{
@ -5245,9 +5250,13 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level,Brw_ExpandTree_
Gbl.Title,
Gbl.Title);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</section>");
break;
case Brw_EXPAND_TREE_MINUS:
/***** Form to contract folder *****/
sprintf (StrAnchor,"folder_%u",++NumAnchor);
fprintf (Gbl.F.Out,"<section id=\"%s\">",StrAnchor);
// Act_FormStartAnchor (Brw_ActContractFolder[Gbl.FileBrowser.Type],StrAnchor);
Act_FormStart (Brw_ActContractFolder[Gbl.FileBrowser.Type]);
switch (Gbl.FileBrowser.Type)
{
@ -5275,6 +5284,7 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level,Brw_ExpandTree_
Gbl.Title,
Gbl.Title);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</section>");
break;
}

View File

@ -1280,6 +1280,7 @@ static void Sta_SeeAccesses (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
{
/***** Put the table with the clicks *****/
/* Write start of table frame */
fprintf (Gbl.F.Out,"<section id=\"stat_results\">");
if (Gbl.Stat.ClicksGroupedBy == Sta_CLICKS_CRS_DETAILED_LIST)
Lay_StartRoundFrameTable ("95%",0,Txt_List_of_detailed_clicks);
else
@ -1340,6 +1341,7 @@ static void Sta_SeeAccesses (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
/* End of frame */
Lay_EndRoundFrameTable ();
fprintf (Gbl.F.Out,"</section>");
}
/***** Free structure that stores the query result *****/
@ -1429,7 +1431,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql
/* Put link to jump to previous page (older clicks) */
if (FirstRow > 1)
{
Act_FormStart (ActSeeAccCrs);
Act_FormStartAnchor (ActSeeAccCrs,"stat_results");
Sta_WriteParamsDatesSeeAccesses ();
Par_PutHiddenParamUnsigned ("GroupedBy",(unsigned) Sta_CLICKS_CRS_DETAILED_LIST);
Par_PutHiddenParamUnsigned ("StatAct",(unsigned) Gbl.Stat.NumAction);
@ -1451,6 +1453,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql
if (FirstRow > 1)
Act_FormEnd ();
/* Write number of current page */
fprintf (Gbl.F.Out,"<td class=\"DAT_N CENTER_MIDDLE\" style=\"width:60%%;\">"
"<strong>"
@ -1464,7 +1467,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql
/* Put link to jump to next page (more recent clicks) */
if (LastRow < NumRows)
{
Act_FormStart (ActSeeAccCrs);
Act_FormStartAnchor (ActSeeAccCrs,"stat_results");
Sta_WriteParamsDatesSeeAccesses ();
Par_PutHiddenParamUnsigned ("GroupedBy",(unsigned) Sta_CLICKS_CRS_DETAILED_LIST);
Par_PutHiddenParamUnsigned ("StatAct",(unsigned) Gbl.Stat.NumAction);