Version 15.225.14

This commit is contained in:
Antonio Cañas Vargas 2016-06-16 18:32:12 +02:00
parent 917d519886
commit 83f5e8d658
5 changed files with 46 additions and 99 deletions

View File

@ -135,8 +135,9 @@
// 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.225.14:Jun 16, 2016 Button in possible duplicate user to show similar users. (? lines)
Version 15.225.13:Jun 16, 2016 Check if a user in listing of possible duplicate users has accepted all his/her courses. (? lines)
Version 15.225.15:Jun 16, 2016 Button in possible duplicate user to show similar users. (? lines)
Version 15.225.14:Jun 16, 2016 Code refactoring in listing of users. (202741 lines)
Version 15.225.13:Jun 16, 2016 Check if a user in listing of possible duplicate users has accepted all his/her courses. (202790 lines)
Version 15.225.12:Jun 16, 2016 New module swad_duplicate for possible duplicate users. (202758 lines)
Version 15.225.11:Jun 16, 2016 Listing possible duplicate users. (202667 lines)
Version 15.225.10:Jun 15, 2016 Listing possible duplicate users. (202626 lines)

View File

@ -133,7 +133,7 @@ void Dpt_SeeDepts (void)
"</a>"
"</td>"
"<td class=\"DAT RIGHT_MIDDLE\">"
"&nbsp;%u&nbsp;"
"%u"
"</td>"
"</tr>",
Gbl.Dpts.Lst[NumDpt].WWW,
@ -159,7 +159,7 @@ void Dpt_SeeDepts (void)
"%s"
"</td>"
"<td class=\"DAT RIGHT_MIDDLE\">"
"&nbsp;%u&nbsp;"
"%u"
"</td>"
"</tr>",
Txt_Other_departments,NumTchsInOtherDpts);
@ -171,7 +171,7 @@ void Dpt_SeeDepts (void)
"%s"
"</td>"
"<td class=\"DAT RIGHT_MIDDLE\">"
"&nbsp;%u&nbsp;"
"%u"
"</td>"
"</tr>",
Txt_Department_unspecified,
@ -579,7 +579,7 @@ static void Dpt_ListDepartmentsForEdition (void)
/* Number of teachers */
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"&nbsp;%u&nbsp;"
"%u"
"</td>"
"</tr>",
Dpt->NumTchs);

View File

@ -120,14 +120,12 @@ void Dup_PutLinkToListDupUsrs (void)
void Dup_ListDuplicateUsrs (void)
{
extern const char *Usr_UsrDatMainFieldNames[Usr_NUM_MAIN_FIELDS_DATA_USR];
extern const char *Txt_Possibly_duplicate_users;
extern const char *Txt_Informants;
extern const char *Txt_No_users_found[Rol_NUM_ROLES];
char Query[1024];
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned NumCol;
unsigned NumUsrs;
unsigned NumUsr;
struct UsrData UsrDat;
@ -156,18 +154,8 @@ void Dup_ListDuplicateUsrs (void)
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\">");
/***** Heading row with column names *****/
/* Start row */
fprintf (Gbl.F.Out,"<tr>");
for (NumCol = 0;
NumCol < Usr_NUM_MAIN_FIELDS_DATA_USR;
NumCol++)
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE LIGHT_BLUE\">"
"%s&nbsp;"
"</th>",
Usr_UsrDatMainFieldNames[NumCol]);
/* End row */
fprintf (Gbl.F.Out,"</tr>");
Gbl.Usrs.Listing.WithPhotos = true;
Usr_WriteHeaderFieldsUsrDat (false); // Columns for the data
/***** List users *****/
for (NumUsr = 0, Gbl.RowEvenOdd = 0;

View File

@ -3125,8 +3125,8 @@ static void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat)
fprintf (Gbl.F.Out,"<tr>");
/***** Write number of user *****/
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL_N RIGHT_MIDDLE COLOR%u\">"
"&nbsp;%u&nbsp;"
fprintf (Gbl.F.Out,"<td class=\"USR_LIST_NUM_N CENTER_MIDDLE COLOR%u\">"
"%u"
"</td>",
Gbl.RowEvenOdd,NumUsr);
@ -5124,13 +5124,40 @@ void Usr_SetUsrDatMainFieldNames (void)
Usr_UsrDatMainFieldNames[8] = Txt_Institution;
}
/*****************************************************************************/
/************ Write header with main field names of user's data **************/
/*****************************************************************************/
void Usr_WriteHeaderFieldsUsrDat (bool PutCheckBoxToSelectUsr)
{
unsigned NumCol;
fprintf (Gbl.F.Out,"<tr>");
/***** First column used for selection *****/
if (PutCheckBoxToSelectUsr)
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE LIGHT_BLUE\">"
"</th>");
/***** Columns for user's data fields *****/
for (NumCol = 0;
NumCol < Usr_NUM_MAIN_FIELDS_DATA_USR;
NumCol++)
if (NumCol != 2 || Gbl.Usrs.Listing.WithPhotos) // Skip photo column if I don't want this column
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE LIGHT_BLUE\">"
"%s&nbsp;"
"</th>",
Usr_UsrDatMainFieldNames[NumCol]);
fprintf (Gbl.F.Out,"</tr>");
}
/*****************************************************************************/
/************************** List guests' main data ***************************/
/*****************************************************************************/
static void Usr_ListMainDataGsts (bool PutCheckBoxToSelectUsr)
{
unsigned NumCol;
unsigned NumUsr;
struct UsrData UsrDat;
@ -5140,27 +5167,7 @@ static void Usr_ListMainDataGsts (bool PutCheckBoxToSelectUsr)
if (Gbl.Usrs.LstGsts.NumUsrs)
{
/***** Heading row with column names *****/
/* Start row */
fprintf (Gbl.F.Out,"<tr>");
/* First column used for selection */
if (PutCheckBoxToSelectUsr)
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE LIGHT_BLUE\">"
"&nbsp;"
"</th>");
/* Columns for the data */
for (NumCol = 0;
NumCol < Usr_NUM_MAIN_FIELDS_DATA_USR;
NumCol++)
if (NumCol != 2 || Gbl.Usrs.Listing.WithPhotos) // Skip photo column if I don't want this column
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE LIGHT_BLUE\">"
"%s&nbsp;"
"</th>",
Usr_UsrDatMainFieldNames[NumCol]);
/* End row */
fprintf (Gbl.F.Out,"</tr>");
Usr_WriteHeaderFieldsUsrDat (PutCheckBoxToSelectUsr); // Columns for the data
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
@ -5197,7 +5204,6 @@ static void Usr_ListMainDataGsts (bool PutCheckBoxToSelectUsr)
static void Usr_ListMainDataStds (bool PutCheckBoxToSelectUsr)
{
unsigned NumCol;
unsigned NumUsr;
char *GroupNames;
struct UsrData UsrDat;
@ -5225,27 +5231,7 @@ static void Usr_ListMainDataStds (bool PutCheckBoxToSelectUsr)
}
/***** Heading row with column names *****/
/* Start row */
fprintf (Gbl.F.Out,"<tr>");
/* First column used for selection */
if (PutCheckBoxToSelectUsr)
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE LIGHT_BLUE\">"
"&nbsp;"
"</th>");
/* Columns for the data */
for (NumCol = 0;
NumCol < Usr_NUM_MAIN_FIELDS_DATA_USR;
NumCol++)
if (NumCol != 2 || Gbl.Usrs.Listing.WithPhotos) // Skip photo column if I don't want this column
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE LIGHT_BLUE\">"
"%s&nbsp;"
"</th>",
Usr_UsrDatMainFieldNames[NumCol]);
/* End row */
fprintf (Gbl.F.Out,"</tr>");
Usr_WriteHeaderFieldsUsrDat (PutCheckBoxToSelectUsr); // Columns for the data
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
@ -5667,7 +5653,6 @@ void Usr_ListAllDataStds (void)
void Usr_ListUsrsForSelection (Rol_Role_t Role)
{
unsigned NumCol;
unsigned NumUsr;
struct UsrData UsrDat;
@ -5675,24 +5660,7 @@ void Usr_ListUsrsForSelection (Rol_Role_t Role)
Usr_SetUsrDatMainFieldNames ();
/***** Heading row with column names *****/
/* Start row and first column used for selection */
fprintf (Gbl.F.Out,"<tr>"
"<th class=\"LEFT_MIDDLE LIGHT_BLUE\">"
"&nbsp;"
"</th>");
/* Columns for the data */
for (NumCol = 0;
NumCol < Usr_NUM_MAIN_FIELDS_DATA_USR;
NumCol++)
if (NumCol != 2 || Gbl.Usrs.Listing.WithPhotos) // Skip photo column if I don't want this column
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE LIGHT_BLUE\">"
"%s&nbsp;"
"</th>",
Usr_UsrDatMainFieldNames[NumCol]);
/* End row */
fprintf (Gbl.F.Out,"</tr>");
Usr_WriteHeaderFieldsUsrDat (true); // Columns for the data
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
@ -5855,7 +5823,6 @@ unsigned Usr_ListUsrsFound (Rol_Role_t Role,const char *UsrQuery)
extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
struct ListUsers *LstUsrs;
Usr_Sex_t Sex;
unsigned NumCol;
unsigned NumUsr;
struct UsrData UsrDat;
unsigned NumUsrs;
@ -5881,18 +5848,8 @@ unsigned Usr_ListUsrsFound (Rol_Role_t Role,const char *UsrQuery)
Lay_StartRoundFrameTable (NULL,2,Gbl.Title);
/***** Heading row with column names *****/
/* Start row */
fprintf (Gbl.F.Out,"<tr>");
for (NumCol = 0;
NumCol < Usr_NUM_MAIN_FIELDS_DATA_USR;
NumCol++)
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE LIGHT_BLUE\">"
"%s&nbsp;"
"</th>",
Usr_UsrDatMainFieldNames[NumCol]);
/* End row */
fprintf (Gbl.F.Out,"</tr>");
Gbl.Usrs.Listing.WithPhotos = true;
Usr_WriteHeaderFieldsUsrDat (false); // Columns for the data
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
@ -6026,7 +5983,7 @@ void Usr_ListDataAdms (void)
fprintf (Gbl.F.Out,"</div>");
/***** Heading row with column names *****/
fprintf (Gbl.F.Out,"<table style=\"margin:0 auto;\">"
fprintf (Gbl.F.Out,"<table>"
"<tr>");
for (NumCol = 0;
NumCol < Usr_NUM_MAIN_FIELDS_DATA_ADM;

View File

@ -320,6 +320,7 @@ void Usr_ShowFormsToSelectUsrListType (Act_Action_t NextAction);
void Usr_PutCheckboxToSelectAllTheUsers (Rol_Role_t Role);
unsigned Usr_GetColumnsForSelectUsrs (void);
void Usr_SetUsrDatMainFieldNames (void);
void Usr_WriteHeaderFieldsUsrDat (bool PutCheckBoxToSelectUsr);
void Usr_PutExtraParamsUsrList (Act_Action_t NextAction);
void Usr_ListUsersToSelect (Rol_Role_t Role);