From 85a0b504306e646e84d4a062a4f42cdc7bcc13b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Fri, 2 Oct 2015 01:04:28 +0200 Subject: [PATCH] Version 15.5 --- css/swad_desktop.css | 6 +- css/swad_mobile.css | 4 +- swad_attendance.c | 21 ++-- swad_changelog.h | 5 +- swad_file_browser.c | 18 ++- swad_message.c | 27 ++-- swad_photo.c | 294 ++++++++++++++++++++++++------------------- swad_statistic.c | 31 +++-- swad_test.c | 33 ++--- swad_text.c | 21 ---- swad_user.c | 125 ++++++++++-------- swad_user.h | 1 - 12 files changed, 324 insertions(+), 262 deletions(-) diff --git a/css/swad_desktop.css b/css/swad_desktop.css index b56535408..549dc2890 100644 --- a/css/swad_desktop.css +++ b/css/swad_desktop.css @@ -417,7 +417,7 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} /****** Contextual links with small icons and text to go to some action ******/ .CONTEXT_MENU { - margin-bottom:12px; + margin:6px 0 8px 0; text-align:center; } .CONTEXT_OPT @@ -772,7 +772,7 @@ a:hover img.CENTRE_PHOTO_SHOW list-style-type:none; border:0; margin:0 auto; - padding:0 0 10px 0; + padding:0 0 4px 0; } #horizontal_menu_container li { @@ -995,7 +995,7 @@ a:hover img.CENTRE_PHOTO_SHOW .MSJ_AVISO {color:#632921; font-size:12pt;} .TIT_TBL {color:#4D88A1; font-size:12pt; font-weight:bold;} .TIT_CLASSPHOTO {font-family:Georgia,"DejaVu LGC Serif","Bitstream Vera Serif",serif; color:#606060; font-size:13pt;} -.CLASSPHOTO {color:#606060; font-size:10pt; line-height:100%; white-space:nowrap;} +.CLASSPHOTO {color:#606060; font-size:10pt; line-height:110%; white-space:nowrap;} .GRP_TITLE {color:#4D88A1; font-size:15pt; font-weight:bold;} diff --git a/css/swad_mobile.css b/css/swad_mobile.css index 67f053cb6..1d168dad1 100644 --- a/css/swad_mobile.css +++ b/css/swad_mobile.css @@ -382,7 +382,7 @@ form {margin:0; display:inline;} /****** Contextual links with small icons and text to go to some action ******/ .CONTEXT_MENU { - margin-bottom:12px; + margin:6px 0 8px 0; text-align:center; } .CONTEXT_OPT @@ -798,7 +798,7 @@ a:hover img.CENTRE_PHOTO_SHOW .MSJ_AVISO {color:#632921; font-size:15pt;} .TIT_TBL {color:#4D88A1; font-size:18pt; font-weight:bold;} .TIT_CLASSPHOTO {font-family:Georgia,"DejaVu LGC Serif","Bitstream Vera Serif",serif; color:#606060; font-size:13pt;} -.CLASSPHOTO {color:#606060; font-size:13pt; line-height:100%; white-space:nowrap;} +.CLASSPHOTO {color:#606060; font-size:13pt; line-height:110%; white-space:nowrap;} .GRP_TITLE {color:#4D88A1; font-size:20pt; font-weight:bold;} diff --git a/swad_attendance.c b/swad_attendance.c index 6e79b3db5..74d6eb25f 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -2597,9 +2597,6 @@ void Usr_ReqListAttendanceStdsCrs (void) /***** Form to select groups *****/ Grp_ShowFormToSelectSeveralGroups (ActReqLstAttStd); - /***** Form to select type of list used for select several users *****/ - Usr_ShowFormsToSelectUsrListType (ActReqLstAttStd); - /***** Get and order lists of users from current course *****/ Usr_GetUsrsLst (Rol_STUDENT,Sco_SCOPE_CRS,NULL,false); @@ -2611,22 +2608,30 @@ void Usr_ReqListAttendanceStdsCrs (void) Usr_GetListsSelectedUsrs (); /***** Draw a class photo with students of the course *****/ + /* Start frame */ + Lay_StartRoundFrame (NULL,Txt_ROLES_PLURAL_Abc[Rol_STUDENT][Usr_SEX_UNKNOWN]); + + /* Form to select type of list used for select several users */ + Usr_ShowFormsToSelectUsrListType (ActReqLstAttStd); + /* Start form */ Act_FormStart (ActSeeLstAttStd); Grp_PutParamsCodGrps (); - /* Start frame */ - Lay_StartRoundFrameTable (NULL,0,Txt_ROLES_PLURAL_Abc[Rol_STUDENT][Usr_SEX_UNKNOWN]); - /* Write list of students to select some of them */ + fprintf (Gbl.F.Out,""); Usr_ListUsersToSelect (Rol_STUDENT); + fprintf (Gbl.F.Out,"
"); - /* Send button and end frame */ - Lay_EndRoundFrameTableWithButton (Lay_CONFIRM_BUTTON,Txt_Show_list); + /* Send button */ + Lay_PutConfirmButton (Txt_Show_list); /* End form */ Act_FormEnd (); + /* End frame */ + Lay_EndRoundFrame (); + /***** Free memory used for by the list of users *****/ Usr_FreeListsSelectedUsrCods (); } diff --git a/swad_changelog.h b/swad_changelog.h index 1c2874669..e3a4880dd 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -98,12 +98,13 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.4.2 (2015/10/01)" +#define Log_PLATFORM_VERSION "SWAD 15.5 (2015/10/01)" // 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.4.2: Oct 31, 2015 Institution admins can edit holidays. (184863 lines) + Version 15.5: Oct 01, 2015 Changes in layout of selectors classphoto/list. (184909 lines) + Version 15.4.2: Oct 01, 2015 Institution admins can edit holidays. (184863 lines) Version 15.4.1: Sep 30, 2015 Code refactoring in global/course statistics. (184861 lines) Version 15.4: Sep 30, 2015 Changes in global/course statistics forms. (184877 lines) Version 15.3.3: Sep 30, 2015 Changes in layout of form to selected initial and final dates. (185152 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index becf98950..ee1690f9f 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -2848,9 +2848,6 @@ void Brw_AskEditWorksCrs (void) /***** Show form to select the groups *****/ Grp_ShowFormToSelectSeveralGroups (ActReqAsgWrkCrs); - /***** Form to select type of list used for select several users *****/ - Usr_ShowFormsToSelectUsrListType (ActReqAsgWrkCrs); - /***** Get and order lists of users from this course *****/ Usr_GetUsrsLst (Rol_TEACHER,Sco_SCOPE_CRS,NULL,false); Usr_GetUsrsLst (Rol_STUDENT,Sco_SCOPE_CRS,NULL,false); @@ -2862,19 +2859,30 @@ void Brw_AskEditWorksCrs (void) Gbl.Usrs.LstStds.NumUsrs)) { /***** Draw class photos to select users *****/ + Lay_StartRoundFrame (NULL,Txt_Users); + + /* Form to select type of list used for select several users */ + Usr_ShowFormsToSelectUsrListType (ActReqAsgWrkCrs); + /* Start form */ Act_FormStart (ActAdmAsgWrkCrs); Grp_PutParamsCodGrps (); Par_PutHiddenParamChar ("FullTree",'Y'); // By default, show all files /* Put list of users to select some of them */ - Lay_StartRoundFrameTable (NULL,0,Txt_Users); + fprintf (Gbl.F.Out,""); Usr_ListUsersToSelect (Rol_TEACHER); Usr_ListUsersToSelect (Rol_STUDENT); - Lay_EndRoundFrameTableWithButton (Lay_CONFIRM_BUTTON,Txt_View_works); + fprintf (Gbl.F.Out,"
"); + + /* Send button */ + Lay_PutConfirmButton (Txt_View_works); /* End form */ Act_FormEnd (); + + /* End frame */ + Lay_EndRoundFrame (); } } else diff --git a/swad_message.c b/swad_message.c index 64741a466..b94fba6e8 100644 --- a/swad_message.c +++ b/swad_message.c @@ -288,9 +288,6 @@ static void Msg_PutFormMsgUsrs (const char *Content) /***** Form to select groups *****/ Grp_ShowFormToSelectSeveralGroups (ActReqMsgUsr); - /***** Form to select type of list used for select several users *****/ - Usr_ShowFormsToSelectUsrListType (ActReqMsgUsr); - /***** Get and order lists of users from this course *****/ Usr_GetUsrsLst (Rol_TEACHER,Sco_SCOPE_CRS,NULL,false); Usr_GetUsrsLst (Rol_STUDENT,Sco_SCOPE_CRS,NULL,false); @@ -304,6 +301,14 @@ static void Msg_PutFormMsgUsrs (const char *Content) if (Usr_GetIfShowBigList (Gbl.Usrs.LstTchs.NumUsrs + Gbl.Usrs.LstStds.NumUsrs)) { + /***** Start frame *****/ + Lay_StartRoundFrame (NULL,Txt_New_message); + + /***** Form to select type of list used for select several users *****/ + if (Gbl.Usrs.LstTchs.NumUsrs || + Gbl.Usrs.LstStds.NumUsrs) + Usr_ShowFormsToSelectUsrListType (ActReqMsgUsr); + /***** Start form to select recipients and write the message *****/ Act_FormStart (ActRcvMsgUsr); if (Gbl.Msg.IsReply) @@ -313,11 +318,9 @@ static void Msg_PutFormMsgUsrs (const char *Content) Usr_PutParamOtherUsrCodEncrypted (); } - /***** Start frame *****/ - Lay_StartRoundFrameTable (NULL,2,Txt_New_message); - /***** Draw lists of users with the recipients *****/ - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out,"" + "" "" @@ -347,13 +350,17 @@ static void Msg_PutFormMsgUsrs (const char *Content) "" - ""); + "" + "
" "%s:" ""); Lay_HelpPlainEditor (); fprintf (Gbl.F.Out,"
"); - /***** End frame *****/ - Lay_EndRoundFrameTableWithButton (Lay_CREATE_BUTTON,Txt_Send_message); + /***** Send button *****/ + Lay_PutCreateButton (Txt_Send_message); /***** End form *****/ Act_FormEnd (); + + /***** End frame *****/ + Lay_EndRoundFrame (); } /***** Free memory used by the list of nicknames *****/ diff --git a/swad_photo.c b/swad_photo.c index abbde61f7..8e439d87a 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -1505,9 +1505,6 @@ void Pho_ShowOrPrintPhotoDegree (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint) fprintf (Gbl.F.Out,""); - /***** Form to select type of list used to display degree photos *****/ - Usr_ShowFormsToSelectUsrListType (ActSeePhoDeg); - /***** Link to print view *****/ Pho_PutLinkToPrintViewOfDegreeStats (); @@ -1886,73 +1883,89 @@ static void Pho_GetMaxStdsPerDegree (void) static void Pho_ShowOrPrintClassPhotoDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint) { extern const char *Txt_Degrees; + extern const char *Txt_No_users_found[Rol_NUM_ROLES]; char Query[512]; MYSQL_RES *mysql_res; MYSQL_ROW row; - unsigned long NumRow,NumRows; + unsigned long NumRow; + unsigned long NumRows; struct Degree Deg; unsigned NumDegsNotEmpty; - int NumStds,NumStdsWithPhoto; + int NumStds; + int NumStdsWithPhoto; struct Date DateAvgPhoto; bool TRIsOpen = false; - /***** Start frame *****/ - Lay_StartRoundFrameTable (NULL,0,Txt_Degrees); - /***** Get degrees from database *****/ Pho_BuildQueryOfDegrees (Query); NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get degrees"); - /***** Get degrees *****/ - for (NumRow = 0, NumDegsNotEmpty = 0; - NumRow < NumRows; - NumRow++) + if (NumRows) // Degrees with students found { - /***** Get next degree *****/ - row = mysql_fetch_row (mysql_res); + /***** Start frame *****/ + Lay_StartRoundFrame (NULL,Txt_Degrees); - /* Get degree code (row[0]) */ - if ((Deg.DegCod = Str_ConvertStrCodToLongCod (row[0])) < 0) - Lay_ShowErrorAndExit ("Wrong code of degree."); + /***** Form to select type of list used to display degree photos *****/ + if (SeeOrPrint == Pho_DEGREES_SEE) + Usr_ShowFormsToSelectUsrListType (ActSeePhoDeg); + fprintf (Gbl.F.Out,""); - /* Get data of degree */ - Deg_GetDataOfDegreeByCod (&Deg); + /***** Get and print degrees *****/ + for (NumRow = 0, NumDegsNotEmpty = 0; + NumRow < NumRows; + NumRow++) + { + /***** Get next degree *****/ + row = mysql_fetch_row (mysql_res); - /* Get number of students and number of students with photo in this degree */ - Pho_GetNumStdsInDegree (Deg.DegCod,Usr_SEX_ALL,&NumStds,&NumStdsWithPhoto); + /* Get degree code (row[0]) */ + if ((Deg.DegCod = Str_ConvertStrCodToLongCod (row[0])) < 0) + Lay_ShowErrorAndExit ("Wrong code of degree."); - if (NumStds > 0) - { - /* Get year, month and day (row[1] holds the date in YYYYMMDD format) */ - if (!(Dat_GetDateFromYYYYMMDD (&DateAvgPhoto,row[1]))) - Lay_ShowErrorAndExit ("Wrong date."); + /* Get data of degree */ + Deg_GetDataOfDegreeByCod (&Deg); - if ((NumDegsNotEmpty % Gbl.Usrs.ClassPhoto.Cols) == 0) - { - fprintf (Gbl.F.Out,""); - TRIsOpen = true; - } + /* Get number of students and number of students with photo in this degree */ + Pho_GetNumStdsInDegree (Deg.DegCod,Usr_SEX_ALL,&NumStds,&NumStdsWithPhoto); - /***** Show average photo of students belonging to this degree *****/ - fprintf (Gbl.F.Out,""); + if (NumStds > 0) + { + /* Get year, month and day (row[1] holds the date in YYYYMMDD format) */ + if (!(Dat_GetDateFromYYYYMMDD (&DateAvgPhoto,row[1]))) + Lay_ShowErrorAndExit ("Wrong date."); - if ((++NumDegsNotEmpty % Gbl.Usrs.ClassPhoto.Cols) == 0) - { - fprintf (Gbl.F.Out,""); - TRIsOpen = false; - } - } + if ((NumDegsNotEmpty % Gbl.Usrs.ClassPhoto.Cols) == 0) + { + fprintf (Gbl.F.Out,""); + TRIsOpen = true; + } + + /***** Show average photo of students belonging to this degree *****/ + fprintf (Gbl.F.Out,""); + + if ((++NumDegsNotEmpty % Gbl.Usrs.ClassPhoto.Cols) == 0) + { + fprintf (Gbl.F.Out,""); + TRIsOpen = false; + } + } + } + if (TRIsOpen) + fprintf (Gbl.F.Out,""); + + fprintf (Gbl.F.Out,"
"); - Pho_ShowDegreeAvgPhotoAndStat (&Deg,SeeOrPrint,Usr_SEX_ALL,NumStds,NumStdsWithPhoto,&DateAvgPhoto); - fprintf (Gbl.F.Out,"
"); + Pho_ShowDegreeAvgPhotoAndStat (&Deg,SeeOrPrint,Usr_SEX_ALL,NumStds,NumStdsWithPhoto,&DateAvgPhoto); + fprintf (Gbl.F.Out,"
"); + + /***** End frame *****/ + Lay_EndRoundFrame (); } - if (TRIsOpen) - fprintf (Gbl.F.Out,""); + else // No degrees with students found + Lay_ShowAlert (Lay_INFO,Txt_No_users_found[Rol_STUDENT]); /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); - /***** End frame *****/ - Lay_EndRoundFrameTable (); } /*****************************************************************************/ @@ -1961,113 +1974,126 @@ static void Pho_ShowOrPrintClassPhotoDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrin static void Pho_ShowOrPrintListDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint) { + extern const char *Txt_Degrees; extern const char *Txt_No_INDEX; extern const char *Txt_Degree; extern const char *Txt_SEX_PLURAL_Abc[Usr_NUM_SEXS]; + extern const char *Txt_No_users_found[Rol_NUM_ROLES]; char Query[512]; MYSQL_RES *mysql_res; MYSQL_ROW row; - unsigned long NumRow,NumRows; + unsigned long NumRow; + unsigned long NumRows; unsigned NumDegsNotEmpty; - int NumStds,NumStdsWithPhoto; + int NumStds; + int NumStdsWithPhoto; struct Date DateAvgPhoto; struct Degree Deg; Usr_Sex_t Sex; - /***** Class photo start *****/ - if (SeeOrPrint == Pho_DEGREES_SEE) - Lay_StartRoundFrameTable (NULL,0,NULL); - else - fprintf (Gbl.F.Out,""); - - /***** Write heading *****/ - fprintf (Gbl.F.Out,"" - "" - "", - Txt_No_INDEX, - Txt_Degree); - for (Sex = (Usr_Sex_t) 0; - Sex < Usr_NUM_SEXS; - Sex++) - fprintf (Gbl.F.Out,"", - Txt_SEX_PLURAL_Abc[Sex]); - fprintf (Gbl.F.Out,""); - /***** Get degrees from database *****/ Pho_BuildQueryOfDegrees (Query); NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get degrees"); - /***** Get degrees *****/ - for (NumRow = 0, Gbl.RowEvenOdd = 0, NumDegsNotEmpty = 0; - NumRow < NumRows; - NumRow++, Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd) + if (NumRows) // Degrees with students found { - /***** Get next degree *****/ - row = mysql_fetch_row (mysql_res); - - /* Get degree code (row[0]) */ - if ((Deg.DegCod = Str_ConvertStrCodToLongCod (row[0])) < 0) - Lay_ShowErrorAndExit ("Wrong code of degree."); - - /* Get year, month and day (row[1] holds the date in YYYYMMDD format) */ - if (!(Dat_GetDateFromYYYYMMDD (&DateAvgPhoto,row[1]))) - Lay_ShowErrorAndExit ("Wrong date."); - - /* Get data of degree */ - Deg_GetDataOfDegreeByCod (&Deg); - - /***** Show logo and name of this degree *****/ - fprintf (Gbl.F.Out,"" - "", - Gbl.RowEvenOdd,++NumDegsNotEmpty); - - /***** Show logo and name of this degree *****/ - fprintf (Gbl.F.Out,""); + { + Lay_StartRoundFrame (NULL,Txt_Degrees); + /***** Form to select type of list used to display degree photos *****/ + Usr_ShowFormsToSelectUsrListType (ActSeePhoDeg); + } + + /***** Write heading *****/ + fprintf (Gbl.F.Out,"
" - "%s" - "" - "%s" - "" - "%s" - "
" - "%u" - "", - Gbl.RowEvenOdd); + /***** Class photo start *****/ if (SeeOrPrint == Pho_DEGREES_SEE) - fprintf (Gbl.F.Out,"", - Deg.WWW,Deg.FullName); - Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName, - 16,"CENTER_TOP",true); - fprintf (Gbl.F.Out," %s ", - Deg.ShortName); - if (SeeOrPrint == Pho_DEGREES_SEE) - fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"
" + "" + "" + "", + Txt_No_INDEX, + Txt_Degree); for (Sex = (Usr_Sex_t) 0; Sex < Usr_NUM_SEXS; Sex++) - { - /***** Show average photo of students belonging to this degree *****/ - Pho_GetNumStdsInDegree (Deg.DegCod,Sex,&NumStds,&NumStdsWithPhoto); - fprintf (Gbl.F.Out,""); - } + fprintf (Gbl.F.Out,"", + Txt_SEX_PLURAL_Abc[Sex]); fprintf (Gbl.F.Out,""); + + /***** Get degrees *****/ + for (NumRow = 0, Gbl.RowEvenOdd = 0, NumDegsNotEmpty = 0; + NumRow < NumRows; + NumRow++, Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd) + { + /***** Get next degree *****/ + row = mysql_fetch_row (mysql_res); + + /* Get degree code (row[0]) */ + if ((Deg.DegCod = Str_ConvertStrCodToLongCod (row[0])) < 0) + Lay_ShowErrorAndExit ("Wrong code of degree."); + + /* Get year, month and day (row[1] holds the date in YYYYMMDD format) */ + if (!(Dat_GetDateFromYYYYMMDD (&DateAvgPhoto,row[1]))) + Lay_ShowErrorAndExit ("Wrong date."); + + /* Get data of degree */ + Deg_GetDataOfDegreeByCod (&Deg); + + /***** Show logo and name of this degree *****/ + fprintf (Gbl.F.Out,"" + "", + Gbl.RowEvenOdd,++NumDegsNotEmpty); + + /***** Show logo and name of this degree *****/ + fprintf (Gbl.F.Out,""); + + for (Sex = (Usr_Sex_t) 0; + Sex < Usr_NUM_SEXS; + Sex++) + { + /***** Show average photo of students belonging to this degree *****/ + Pho_GetNumStdsInDegree (Deg.DegCod,Sex,&NumStds,&NumStdsWithPhoto); + fprintf (Gbl.F.Out,""); + } + fprintf (Gbl.F.Out,""); + } + + /***** Photos end *****/ + fprintf (Gbl.F.Out,"
" + "%s" + "" + "%s" + "", - Gbl.RowEvenOdd); - if (Gbl.Usrs.Listing.WithPhotos) - Pho_ShowDegreeAvgPhotoAndStat (&Deg,SeeOrPrint,Sex,NumStds,NumStdsWithPhoto,&DateAvgPhoto); - else - Pho_ShowDegreeStat (NumStds,NumStdsWithPhoto); - fprintf (Gbl.F.Out,"" + "%s" + "
" + "%u" + "", + Gbl.RowEvenOdd); + if (SeeOrPrint == Pho_DEGREES_SEE) + fprintf (Gbl.F.Out,"", + Deg.WWW,Deg.FullName); + Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName, + 16,"CENTER_TOP",true); + fprintf (Gbl.F.Out," %s ", + Deg.ShortName); + if (SeeOrPrint == Pho_DEGREES_SEE) + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"", + Gbl.RowEvenOdd); + if (Gbl.Usrs.Listing.WithPhotos) + Pho_ShowDegreeAvgPhotoAndStat (&Deg,SeeOrPrint,Sex,NumStds,NumStdsWithPhoto,&DateAvgPhoto); + else + Pho_ShowDegreeStat (NumStds,NumStdsWithPhoto); + fprintf (Gbl.F.Out,"
"); + if (SeeOrPrint == Pho_DEGREES_SEE) + Lay_EndRoundFrame (); } + else // No degrees with students found! + Lay_ShowAlert (Lay_INFO,Txt_No_users_found[Rol_STUDENT]); /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); - - /***** Photos end *****/ - if (SeeOrPrint == Pho_DEGREES_SEE) - Lay_EndRoundFrameTable (); - else - fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -2081,25 +2107,33 @@ static void Pho_BuildQueryOfDegrees (char *Query) case Pho_NUMBER_OF_STUDENTS: sprintf (Query,"SELECT degrees.DegCod,DATE_FORMAT(sta_degrees.TimeAvgPhoto,'%%Y%%m%%d')" " FROM degrees,sta_degrees" - " WHERE sta_degrees.Sex='all' AND sta_degrees.NumStds>'0' AND degrees.DegCod=sta_degrees.DegCod" + " WHERE sta_degrees.Sex='all'" + " AND sta_degrees.NumStds>'0'" + " AND degrees.DegCod=sta_degrees.DegCod" " ORDER BY sta_degrees.NumStds DESC,sta_degrees.NumStdsWithPhoto DESC,degrees.ShortName"); break; case Pho_NUMBER_OF_PHOTOS: sprintf (Query,"SELECT degrees.DegCod,DATE_FORMAT(sta_degrees.TimeAvgPhoto,'%%Y%%m%%d')" " FROM degrees,sta_degrees" - " WHERE sta_degrees.Sex='all' AND sta_degrees.NumStds>'0' AND degrees.DegCod=sta_degrees.DegCod" + " WHERE sta_degrees.Sex='all'" + " AND sta_degrees.NumStds>'0'" + " AND degrees.DegCod=sta_degrees.DegCod" " ORDER BY sta_degrees.NumStdsWithPhoto DESC,sta_degrees.NumStds DESC,degrees.ShortName"); break; case Pho_PERCENT: sprintf (Query,"SELECT degrees.DegCod,DATE_FORMAT(sta_degrees.TimeAvgPhoto,'%%Y%%m%%d')" " FROM degrees,sta_degrees" - " WHERE sta_degrees.Sex='all' AND sta_degrees.NumStds>'0' AND degrees.DegCod=sta_degrees.DegCod" + " WHERE sta_degrees.Sex='all'" + " AND sta_degrees.NumStds>'0'" + " AND degrees.DegCod=sta_degrees.DegCod" " ORDER BY sta_degrees.NumStdsWithPhoto/sta_degrees.NumStds DESC,degrees.ShortName"); break; case Pho_DEGREE_NAME: sprintf (Query,"SELECT degrees.DegCod,DATE_FORMAT(sta_degrees.TimeAvgPhoto,'%%Y%%m%%d')" " FROM degrees,sta_degrees" - " WHERE sta_degrees.Sex='all' AND sta_degrees.NumStds>'0' AND degrees.DegCod=sta_degrees.DegCod" + " WHERE sta_degrees.Sex='all'" + " AND sta_degrees.NumStds>'0'" + " AND degrees.DegCod=sta_degrees.DegCod" " ORDER BY degrees.ShortName"); break; } diff --git a/swad_statistic.c b/swad_statistic.c index ecdb8e4d3..d74e20012 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -419,9 +419,6 @@ void Sta_AskSeeCrsAccesses (void) /***** Show form to select the grupos *****/ Grp_ShowFormToSelectSeveralGroups (ActReqAccCrs); - /***** Form to select type of list used for select several users *****/ - Usr_ShowFormsToSelectUsrListType (ActReqAccCrs); - /***** Get and order the lists of users of this course *****/ Usr_GetUsrsLst (Rol_TEACHER,Sco_SCOPE_CRS,NULL,false); Usr_GetUsrsLst (Rol_STUDENT,Sco_SCOPE_CRS,NULL,false); @@ -435,18 +432,24 @@ void Sta_AskSeeCrsAccesses (void) /***** Get lists of selected users *****/ Usr_GetListsSelectedUsrs (); + /***** Start frame *****/ + sprintf (Gbl.Title,Txt_Statistics_of_visits_to_the_course_X, + Gbl.CurrentCrs.Crs.ShortName); + Lay_StartRoundFrame (NULL,Gbl.Title); + + /***** Form to select type of list used for select several users *****/ + Usr_ShowFormsToSelectUsrListType (ActReqAccCrs); + + /***** Start form *****/ Act_FormStart (ActSeeAccCrs); Grp_PutParamsCodGrps (); Par_PutHiddenParamLong ("FirstRow",0); Par_PutHiddenParamLong ("LastRow",0); - /***** Start frame *****/ - sprintf (Gbl.Title,Txt_Statistics_of_visits_to_the_course_X, - Gbl.CurrentCrs.Crs.ShortName); - Lay_StartRoundFrameTable (NULL,2,Gbl.Title); - /***** Put list of users to select some of them *****/ - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out,"" + "" "" @@ -530,14 +533,18 @@ void Sta_AskSeeCrsAccesses (void) } fprintf (Gbl.F.Out,")" "" - ""); + "" + "
" "%s:" "
"); - /***** End frame *****/ - Lay_EndRoundFrameTableWithButton (Lay_CONFIRM_BUTTON,Txt_Show_visits); + /***** Send button *****/ + Lay_PutConfirmButton (Txt_Show_visits); /***** End form *****/ Act_FormEnd (); + /***** End frame *****/ + Lay_EndRoundFrame (); + /* Free the memory used by the list of users */ Usr_FreeListsSelectedUsrCods (); } diff --git a/swad_test.c b/swad_test.c index 650ae939e..29b869b94 100644 --- a/swad_test.c +++ b/swad_test.c @@ -5897,9 +5897,6 @@ void Tst_SelUsrsToSeeUsrsTstExams (void) /***** Show form to select the groups *****/ Grp_ShowFormToSelectSeveralGroups (ActReqSeeUsrTstExa); - /***** Form to select type of list used for select several users *****/ - Usr_ShowFormsToSelectUsrListType (ActReqSeeUsrTstExa); - /***** Get and order lists of users from this course *****/ Usr_GetUsrsLst (Rol_TEACHER,Sco_SCOPE_CRS,NULL,false); Usr_GetUsrsLst (Rol_STUDENT,Sco_SCOPE_CRS,NULL,false); @@ -5910,31 +5907,35 @@ void Tst_SelUsrsToSeeUsrsTstExams (void) if (Usr_GetIfShowBigList (Gbl.Usrs.LstTchs.NumUsrs + Gbl.Usrs.LstStds.NumUsrs)) { + /***** Start frame *****/ + Lay_StartRoundFrame (NULL,Txt_Users); + + /***** Form to select type of list used for select several users *****/ + Usr_ShowFormsToSelectUsrListType (ActReqSeeUsrTstExa); + /***** Start form *****/ Act_FormStart (ActSeeUsrTstExa); Grp_PutParamsCodGrps (); - fprintf (Gbl.F.Out,"
" - "" - "" - "
"); /***** Put list of users to select some of them *****/ - Lay_StartRoundFrameTable (NULL,0,Txt_Users); + fprintf (Gbl.F.Out,""); Usr_ListUsersToSelect (Rol_TEACHER); Usr_ListUsersToSelect (Rol_STUDENT); - Lay_EndRoundFrameTable (); - - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,"
"); /***** Starting and ending dates in the search *****/ + fprintf (Gbl.F.Out,""); Dat_WriteFormIniEndDates (); + fprintf (Gbl.F.Out,"
"); - /***** Button to send the form *****/ - fprintf (Gbl.F.Out,"
" - "
"); - Lay_PutConfirmButton (Txt_See_exams); + /***** Send button *****/ + Lay_PutConfirmButton (Txt_See_exams); + + /***** End form *****/ Act_FormEnd (); + + /***** End frame *****/ + Lay_EndRoundFrame (); } } else diff --git a/swad_text.c b/swad_text.c index c47f64513..dec8708a5 100644 --- a/swad_text.c +++ b/swad_text.c @@ -15640,27 +15640,6 @@ const char *Txt_List_of_nicks_emails_or_IDs = "Lista de @alcunhas, e-mails ou nºs. identif."; #endif -const char *Txt_List_type = -#if L==0 - "Tipus de llista"; -#elif L==1 - "Listentyp"; -#elif L==2 - "List type"; -#elif L==3 - "Tipo de lista"; -#elif L==4 - "Type de liste"; -#elif L==5 - "Tipo de lista"; // Okoteve traducción -#elif L==6 - "Tipo di lista"; -#elif L==7 - "Typ listy"; -#elif L==8 - "Tipo de lista"; -#endif - const char *Txt_Links = #if L==0 "Enllaços"; diff --git a/swad_user.c b/swad_user.c index 279b1827c..111033cf6 100644 --- a/swad_user.c +++ b/swad_user.c @@ -146,6 +146,7 @@ static void Usr_FormToSelectUsrListType (Act_Action_t NextAction,Usr_ShowUsrsTyp static Usr_Sex_t Usr_GetSexOfUsrsLst (struct ListUsers *LstUsrs); static void Usr_PutCheckboxToSelectUser (struct UsrData *UsrDat,bool UsrIsTheMsgSender); +static void Usr_PutCheckboxListWithPhotos (void); static void Usr_SetUsrDatMainFieldNames (void); static void Usr_ListMainDataGsts (bool PutCheckBoxToSelectUsr); @@ -4758,13 +4759,9 @@ void Usr_FreeListOtherRecipients (void) void Usr_ShowFormsToSelectUsrListType (Act_Action_t NextAction) { - extern const char *Txt_List_type; - - /***** Start table *****/ - Lay_StartRoundFrameTable (NULL,8,Txt_List_type); - /***** Select USR_CLASS_ROOM *****/ - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out,"" + "" "" - ""); - - /***** End of table *****/ - Lay_EndRoundFrameTable (); + "" + "
", Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO ? "USR_LIST_TYPE_ON" : "USR_LIST_TYPE_OFF"); @@ -4794,10 +4791,8 @@ void Usr_ShowFormsToSelectUsrListType (Act_Action_t NextAction) Usr_PutCheckboxListWithPhotos (); Act_FormEnd (); fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ @@ -5007,7 +5002,7 @@ static void Usr_PutCheckboxToSelectUser (struct UsrData *UsrDat,bool UsrIsTheMsg /********* Put a checkbox to select whether list users with photos ***********/ /*****************************************************************************/ -void Usr_PutCheckboxListWithPhotos (void) +static void Usr_PutCheckboxListWithPhotos (void) { extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *Txt_Display_photos; @@ -5943,23 +5938,25 @@ void Usr_ListDataAdms (void) if (Gbl.Usrs.LstAdms.NumUsrs) { - /****** See the photos? *****/ - fprintf (Gbl.F.Out,"
"); + /***** Initialize number of columns *****/ + NumColumns = Usr_NUM_MAIN_FIELDS_DATA_ADM; + + /***** Start table with list of administrators *****/ + Lay_StartRoundFrame (NULL,Txt_ROLES_PLURAL_Abc[Rol_DEG_ADM][Usr_SEX_UNKNOWN]); + + /****** Show photos? *****/ + fprintf (Gbl.F.Out,"
"); Act_FormStart (ActLstOth); Sco_PutParamScope (Gbl.Scope.Current); Usr_PutCheckboxListWithPhotos (); Act_FormEnd (); fprintf (Gbl.F.Out,"
"); - /***** Initialize number of columns *****/ - NumColumns = Usr_NUM_MAIN_FIELDS_DATA_ADM; - - /***** Start table with list of administrators *****/ - Lay_StartRoundFrameTable (NULL,0,Txt_ROLES_PLURAL_Abc[Rol_DEG_ADM][Usr_SEX_UNKNOWN]); - /***** Heading row with column names *****/ /* Start row */ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"" + ""); for (NumCol = 0; NumCol < NumColumns; NumCol++) @@ -5991,7 +5988,8 @@ void Usr_ListDataAdms (void) Usr_UsrDataDestructor (&UsrDat); /***** End of table *****/ - Lay_EndRoundFrameTable (); + fprintf (Gbl.F.Out,"
"); + Lay_EndRoundFrame (); } else // Gbl.Usrs.LstAdms.NumUsrs == 0 Lay_ShowAlert (Lay_INFO,Txt_No_users_found[Rol_DEG_ADM]); @@ -6412,9 +6410,6 @@ void Usr_SeeGuests (void) break; } - /***** Form to select type of list of users *****/ - Usr_ShowFormsToSelectUsrListType (ActLstGst); - /***** Get and order list of students in current scope *****/ Usr_GetGstsLst (Gbl.Scope.Current); @@ -6441,13 +6436,19 @@ void Usr_SeeGuests (void) } fprintf (Gbl.F.Out,"
"); + /***** Start frame *****/ + Lay_StartRoundFrame (NULL,Txt_ROLES_PLURAL_Abc[Rol__GUEST_][Usr_SEX_UNKNOWN]); + + /***** Form to select type of list of users *****/ + Usr_ShowFormsToSelectUsrListType (ActLstGst); + /***** Draw a class photo with students of the course *****/ /* Start form */ Act_FormStart (ActSeeRecSevGst); Grp_PutParamsCodGrps (); - /* Header */ - Lay_StartRoundFrameTable (NULL,0,Txt_ROLES_PLURAL_Abc[Rol__GUEST_][Usr_SEX_UNKNOWN]); + /* Start table */ + fprintf (Gbl.F.Out,""); if (Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO) Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,false,true, @@ -6472,11 +6473,17 @@ void Usr_SeeGuests (void) break; } - /* Send button and end frame */ - Lay_EndRoundFrameTableWithButton (Lay_CONFIRM_BUTTON,Txt_Show_records); + /* End table */ + fprintf (Gbl.F.Out,"
"); + + /* Send button */ + Lay_PutConfirmButton (Txt_Show_records); /* End form */ Act_FormEnd (); + + /* End frame */ + Lay_EndRoundFrame (); } } else @@ -6588,9 +6595,6 @@ void Usr_SeeStudents (void) if (Gbl.Scope.Current == Sco_SCOPE_CRS) Grp_ShowFormToSelectSeveralGroups (ActLstStd); - /***** Form to select type of list of users *****/ - Usr_ShowFormsToSelectUsrListType (ActLstStd); - /***** Get and order list of students *****/ Usr_GetUsrsLst (Rol_STUDENT,Gbl.Scope.Current,NULL,false); @@ -6622,6 +6626,12 @@ void Usr_SeeStudents (void) break; } + /***** Start frame *****/ + Lay_StartRoundFrame (NULL,Txt_ROLES_PLURAL_Abc[Rol_STUDENT][Usr_SEX_UNKNOWN]); + + /***** Form to select type of list of users *****/ + Usr_ShowFormsToSelectUsrListType (ActLstStd); + /***** Draw a class photo with students of the course *****/ /* Start form */ if (ICanViewRecords) @@ -6630,8 +6640,8 @@ void Usr_SeeStudents (void) Grp_PutParamsCodGrps (); } - /* Header */ - Lay_StartRoundFrameTable (NULL,0,Txt_ROLES_PLURAL_Abc[Rol_STUDENT][Usr_SEX_UNKNOWN]); + /* Start table */ + fprintf (Gbl.F.Out,""); if (Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO) Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,false,true, @@ -6663,14 +6673,20 @@ void Usr_SeeStudents (void) break; } - /* Send button and end frame */ + /* End table */ + fprintf (Gbl.F.Out,"
"); + if (ICanViewRecords) { - Lay_EndRoundFrameTableWithButton (Lay_CONFIRM_BUTTON,Txt_Show_records); - Act_FormEnd (); + /* Send button */ + Lay_PutConfirmButton (Txt_Show_records); + + /* End form */ + Act_FormEnd (); } - else - Lay_EndRoundFrameTable (); + + /* End frame */ + Lay_EndRoundFrame (); } } else @@ -6742,9 +6758,6 @@ void Usr_SeeTeachers (void) Act_FormEnd (); fprintf (Gbl.F.Out,""); - /***** Form to select type of list of users *****/ - Usr_ShowFormsToSelectUsrListType (ActLstTch); - /***** Get and order list of teachers *****/ Usr_GetUsrsLst (Rol_TEACHER,Gbl.Scope.Current,NULL,false); @@ -6773,15 +6786,19 @@ void Usr_SeeTeachers (void) break; } - /***** Draw a class photo with teachers of the course *****/ - fprintf (Gbl.F.Out,"
"); + /***** Start frame *****/ + Lay_StartRoundFrame (NULL,Txt_ROLES_PLURAL_Abc[Rol_TEACHER][Usr_SEX_UNKNOWN]); + /***** Form to select type of list of users *****/ + Usr_ShowFormsToSelectUsrListType (ActLstTch); + + /***** Draw a class photo with teachers of the course *****/ /* Start form */ if (ICanViewRecords) Act_FormStart (ActSeeRecSevTch); - /* Header */ - Lay_StartRoundFrameTable (NULL,0,Txt_ROLES_PLURAL_Abc[Rol_TEACHER][Usr_SEX_UNKNOWN]); + /* Start table */ + fprintf (Gbl.F.Out,""); if (Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO) Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,false,true, @@ -6813,16 +6830,20 @@ void Usr_SeeTeachers (void) break; } - /* Send button and end frame */ + /* End table */ + fprintf (Gbl.F.Out,"
"); + if (ICanViewRecords) { - Lay_EndRoundFrameTableWithButton (Lay_CONFIRM_BUTTON,Txt_Show_records); - Act_FormEnd (); - } - else - Lay_EndRoundFrameTable (); + /* Send button */ + Lay_PutConfirmButton (Txt_Show_records); - fprintf (Gbl.F.Out,"
"); + /* End form */ + Act_FormEnd (); + } + + /* End frame */ + Lay_EndRoundFrame (); } } else diff --git a/swad_user.h b/swad_user.h index f364ddf5d..48d798f1c 100644 --- a/swad_user.h +++ b/swad_user.h @@ -308,7 +308,6 @@ unsigned Usr_GetColumnsForSelectUsrs (void); void Usr_PutExtraParamsUsrList (Act_Action_t NextAction); void Usr_ListUsersToSelect (Rol_Role_t Role); -void Usr_PutCheckboxListWithPhotos (void); void Usr_ListAllDataGsts (void); void Usr_ListAllDataStds (void); void Usr_ListUsrsForSelection (Rol_Role_t Role);