Version 15.155

This commit is contained in:
Antonio Cañas Vargas 2016-03-20 00:33:27 +01:00
parent a6d584b747
commit 21fed46c97
4 changed files with 111 additions and 88 deletions

View File

@ -712,7 +712,7 @@ a:hover /* Default ==> underlined */
} }
#main_horizontal .MENU_OPT_OFF #main_horizontal .MENU_OPT_OFF
{ {
opacity:0.67; opacity:0.667;
} }
#main_horizontal .MENU_OPT_OFF:hover, #main_horizontal .MENU_OPT_ON #main_horizontal .MENU_OPT_OFF:hover, #main_horizontal .MENU_OPT_ON
{ {

View File

@ -71,6 +71,9 @@ typedef enum
static void Att_ShowAllAttEvents (void); static void Att_ShowAllAttEvents (void);
static void Att_PutFormToSelectWhichGroupsToShow (void); static void Att_PutFormToSelectWhichGroupsToShow (void);
static void Att_PutIconToCreateNewAttEvent (void);
static void Att_PutButtonToCreateNewAttEvent (void);
static void Att_PutParamsToCreateNewAttEvent (void);
static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAttEventComplete); static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAttEventComplete);
static void Att_WriteAttEventAuthor (struct AttendanceEvent *Att); static void Att_WriteAttEventAuthor (struct AttendanceEvent *Att);
static void Att_GetParamAttOrderType (void); static void Att_GetParamAttOrderType (void);
@ -79,9 +82,6 @@ static void Att_PutFormToListMyAttendance (void);
static void Att_PutFormToListStdsAttendance (void); static void Att_PutFormToListStdsAttendance (void);
static void Att_PutFormToListStdsParams (void); static void Att_PutFormToListStdsParams (void);
static void Att_PutFormToCreateNewAttEvent (void);
static void Att_PutFormToCreateNewAttEventParams (void);
static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden); static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden);
static void Att_PutParams (void); static void Att_PutParams (void);
static void Att_GetListAttEvents (Att_OrderTime_t Order); static void Att_GetListAttEvents (Att_OrderTime_t Order);
@ -131,8 +131,6 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat);
void Att_SeeAttEvents (void) void Att_SeeAttEvents (void)
{ {
extern const char *Txt_No_events;
/***** Get parameters *****/ /***** Get parameters *****/
Att_GetParamAttOrderType (); Att_GetParamAttOrderType ();
Grp_GetParamWhichGrps (); Grp_GetParamWhichGrps ();
@ -142,39 +140,35 @@ void Att_SeeAttEvents (void)
Att_GetListAttEvents (Att_NEWEST_FIRST); Att_GetListAttEvents (Att_NEWEST_FIRST);
/***** Show contextual menu *****/ /***** Show contextual menu *****/
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">"); if (Gbl.AttEvents.Num ||
Gbl.Usrs.Me.UsrDat.Nickname[0])
/* Put link (form) to create a bew attendance event */
switch (Gbl.Usrs.Me.LoggedRole)
{ {
case Rol_STUDENT: fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
if (Gbl.AttEvents.Num)
Att_PutFormToListMyAttendance (); /* Put link to show list of attendance */
break; if (Gbl.AttEvents.Num)
case Rol_TEACHER: switch (Gbl.Usrs.Me.LoggedRole)
case Rol_SYS_ADM: {
Att_PutFormToCreateNewAttEvent (); case Rol_STUDENT:
if (Gbl.AttEvents.Num) Att_PutFormToListMyAttendance ();
Att_PutFormToListStdsAttendance (); break;
break; case Rol_TEACHER:
default: case Rol_SYS_ADM:
break; Att_PutFormToListStdsAttendance ();
break;
default:
break;
}
/* Put link to my QR code */
if (Gbl.Usrs.Me.UsrDat.Nickname[0])
QR_PutLinkToPrintQRCode (Gbl.Usrs.Me.UsrDat.Nickname,true);
fprintf (Gbl.F.Out,"</div>");
} }
/* Put link to my QR code */
if (Gbl.Usrs.Me.UsrDat.Nickname[0])
QR_PutLinkToPrintQRCode (Gbl.Usrs.Me.UsrDat.Nickname,true);
fprintf (Gbl.F.Out,"</div>");
/***** Show all the attendance events *****/ /***** Show all the attendance events *****/
if (Gbl.AttEvents.Num) Att_ShowAllAttEvents ();
Att_ShowAllAttEvents ();
else
Lay_ShowAlert (Lay_INFO,Txt_No_events);
/***** Free list of attendance events *****/
Att_FreeListAttEvents ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -188,35 +182,36 @@ static void Att_ShowAllAttEvents (void)
extern const char *Txt_ASG_ATT_OR_SVY_ORDER[2]; extern const char *Txt_ASG_ATT_OR_SVY_ORDER[2];
extern const char *Txt_Event; extern const char *Txt_Event;
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
extern const char *Txt_No_events;
Att_EventsOrderType_t Order; Att_EventsOrderType_t Order;
struct Pagination Pagination; struct Pagination Pagination;
unsigned NumAttEvent; unsigned NumAttEvent;
/***** Compute variables related to pagination *****/ /***** Compute variables related to pagination *****/
Pagination.NumItems = Gbl.AttEvents.Num; Pagination.NumItems = Gbl.AttEvents.Num;
Pagination.CurrentPage = (int) Gbl.Pag.CurrentPage; Pagination.CurrentPage = (int) Gbl.Pag.CurrentPage;
Pag_CalculatePagination (&Pagination); Pag_CalculatePagination (&Pagination);
Gbl.Pag.CurrentPage = (unsigned) Pagination.CurrentPage; Gbl.Pag.CurrentPage = (unsigned) Pagination.CurrentPage;
/***** Write links to pages *****/ /***** Write links to pages *****/
if (Pagination.MoreThanOnePage) if (Pagination.MoreThanOnePage)
Pag_WriteLinksToPagesCentered (Pag_ATT_EVENTS,0,&Pagination); Pag_WriteLinksToPagesCentered (Pag_ATT_EVENTS,0,&Pagination);
/***** Table start *****/ /***** Start frame *****/
Lay_StartRoundFrameTable (NULL,2,Txt_Events); Lay_StartRoundFrame ("100%",Txt_Events,
(Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) ? Att_PutIconToCreateNewAttEvent :
NULL);
/***** Select whether show only my groups or all groups *****/ /***** Select whether show only my groups or all groups *****/
if (Gbl.CurrentCrs.Grps.NumGrps) if (Gbl.CurrentCrs.Grps.NumGrps)
{ Att_PutFormToSelectWhichGroupsToShow ();
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"4\">");
Att_PutFormToSelectWhichGroupsToShow ();
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
if (Gbl.AttEvents.Num)
{
/***** Table head *****/ /***** Table head *****/
fprintf (Gbl.F.Out,"<tr>"); fprintf (Gbl.F.Out,"<table class=\"FRAME_TABLE CELLS_PAD_2\">"
"<tr>");
for (Order = Att_ORDER_BY_START_DATE; for (Order = Att_ORDER_BY_START_DATE;
Order <= Att_ORDER_BY_END_DATE; Order <= Att_ORDER_BY_END_DATE;
Order++) Order++)
@ -252,12 +247,24 @@ static void Att_ShowAllAttEvents (void)
NumAttEvent++) NumAttEvent++)
Att_ShowOneAttEvent (&Gbl.AttEvents.Lst[NumAttEvent-1],false); Att_ShowOneAttEvent (&Gbl.AttEvents.Lst[NumAttEvent-1],false);
/***** Table end *****/ /***** End table *****/
Lay_EndRoundFrameTable (); fprintf (Gbl.F.Out,"</table>");
}
else // No events created
Lay_ShowAlert (Lay_INFO,Txt_No_events);
/***** Write again links to pages *****/ /***** Button to create a new attendance event *****/
if (Pagination.MoreThanOnePage) Att_PutButtonToCreateNewAttEvent ();
Pag_WriteLinksToPagesCentered (Pag_ATT_EVENTS,0,&Pagination);
/***** End frame *****/
Lay_EndRoundFrame ();
/***** Write again links to pages *****/
if (Pagination.MoreThanOnePage)
Pag_WriteLinksToPagesCentered (Pag_ATT_EVENTS,0,&Pagination);
/***** Free list of attendance events *****/
Att_FreeListAttEvents ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -273,6 +280,44 @@ static void Att_PutFormToSelectWhichGroupsToShow (void)
Act_FormEnd (); Act_FormEnd ();
} }
/*****************************************************************************/
/**************** Put icon to create a new attendance event ******************/
/*****************************************************************************/
static void Att_PutIconToCreateNewAttEvent (void)
{
extern const char *Txt_New_event;
/***** Put form to create a new attendance event *****/
Lay_PutContextualLink (ActFrmNewAtt,Att_PutParamsToCreateNewAttEvent,
"plus64x64.png",Txt_New_event,NULL);
}
/*****************************************************************************/
/**************** Put button to create a new attendance event ****************/
/*****************************************************************************/
static void Att_PutButtonToCreateNewAttEvent (void)
{
extern const char *Txt_New_event;
Act_FormStart (ActFrmNewAtt);
Att_PutParamsToCreateNewAttEvent ();
Lay_PutConfirmButton (Txt_New_event);
Act_FormEnd ();
}
/*****************************************************************************/
/************** Put parameters to create a new attendance event **************/
/*****************************************************************************/
static void Att_PutParamsToCreateNewAttEvent (void)
{
Att_PutHiddenParamAttOrderType ();
Grp_PutParamWhichGrps ();
Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
}
/*****************************************************************************/ /*****************************************************************************/
/************************* Show one attendance event *************************/ /************************* Show one attendance event *************************/
/*****************************************************************************/ /*****************************************************************************/
@ -492,28 +537,6 @@ static void Att_PutFormToListStdsParams (void)
Grp_PutParamWhichGrps (); Grp_PutParamWhichGrps ();
Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
} }
/*****************************************************************************/
/*********** Put a link (form) to create a new attendance event **************/
/*****************************************************************************/
static void Att_PutFormToCreateNewAttEvent (void)
{
extern const char *Txt_New_event;
/***** Put form to create a new attendance event *****/
Lay_PutContextualLink (ActFrmNewAtt,Att_PutFormToCreateNewAttEventParams,
"plus64x64.png",
Txt_New_event,Txt_New_event);
}
static void Att_PutFormToCreateNewAttEventParams (void)
{
Att_PutHiddenParamAttOrderType ();
Grp_PutParamWhichGrps ();
Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
}
/*****************************************************************************/ /*****************************************************************************/
/************** Put a link (form) to edit one attendance event ***************/ /************** Put a link (form) to edit one attendance event ***************/
/*****************************************************************************/ /*****************************************************************************/
@ -1136,9 +1159,7 @@ void Att_RequestCreatOrEditAttEvent (void)
/***** Show current attendance events *****/ /***** Show current attendance events *****/
Att_GetListAttEvents (Att_NEWEST_FIRST); Att_GetListAttEvents (Att_NEWEST_FIRST);
if (Gbl.AttEvents.Num) Att_ShowAllAttEvents ();
Att_ShowAllAttEvents ();
Att_FreeListAttEvents ();
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -132,13 +132,15 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.154 (2016-03-19)" #define Log_PLATFORM_VERSION "SWAD 15.155 (2016-03-20)"
#define CSS_FILE "swad15.152.css" #define CSS_FILE "swad15.152.css"
#define JS_FILE "swad15.131.3.js" #define JS_FILE "swad15.131.3.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/* /*
Version 15.155: Mar 20, 2016 Icon to add new attendance event integrated in frame.
Changes in layout of attendance events. (196038 lines)
Version 15.154: Mar 19, 2016 Icon to add new survey integrated in frame. Version 15.154: Mar 19, 2016 Icon to add new survey integrated in frame.
Changes in layout of surveys. (196018 lines) Changes in layout of surveys. (196018 lines)
Version 15.153.1: Mar 19, 2016 Fixed layout in edition of assignments. (195980 lines) Version 15.153.1: Mar 19, 2016 Fixed layout in edition of assignments. (195980 lines)

View File

@ -244,10 +244,10 @@ static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst)
NumSvy++) NumSvy++)
Svy_ShowOneSurvey (Gbl.Svys.LstSvyCods[NumSvy-1],SvyQst,false); Svy_ShowOneSurvey (Gbl.Svys.LstSvyCods[NumSvy-1],SvyQst,false);
/***** Table end *****/ /***** End table *****/
fprintf (Gbl.F.Out,"</table>"); fprintf (Gbl.F.Out,"</table>");
} }
else // No assignments created else // No surveys created
Lay_ShowAlert (Lay_INFO,Txt_No_surveys); Lay_ShowAlert (Lay_INFO,Txt_No_surveys);
/***** Button to create a new survey *****/ /***** Button to create a new survey *****/