mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-26 10:25:45 +02:00
Version 15.226.2
This commit is contained in:
parent
376f0bbc24
commit
50fe72d03e
|
@ -1058,6 +1058,7 @@ Users:
|
|||
|
||||
NEW. ActLstDupUsr List possible duplicate users
|
||||
NEW. ActLstSimUsr List users similar to a given one (possible duplicates)
|
||||
NEW. ActRemDupUsr Remove user from list of possible duplicate users
|
||||
|
||||
884. ActLstClk List last clicks in real time
|
||||
Social:
|
||||
|
@ -2455,6 +2456,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
|
||||
/* ActLstDupUsr */{1578,-1,TabUsr,ActLstOth ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Dup_ListDuplicateUsrs ,NULL},
|
||||
/* ActLstSimUsr */{1579,-1,TabUsr,ActLstOth ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Dup_ListSimilarUsrs ,NULL},
|
||||
/* ActRemDupUsr */{1580,-1,TabUsr,ActLstOth ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Dup_RemoveUsrFromListDupUsrs ,NULL},
|
||||
|
||||
/* ActLstClk */{ 989,-1,TabUsr,ActLstCon ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Con_ShowLastClicks ,NULL},
|
||||
|
||||
|
@ -4421,6 +4423,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
|
|||
ActReqRemMyPho, // #1577
|
||||
ActLstDupUsr, // #1578
|
||||
ActLstSimUsr, // #1579
|
||||
ActRemDupUsr, // #1580
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -72,9 +72,9 @@ typedef enum
|
|||
|
||||
typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
||||
|
||||
#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+246+186+155+172+36+28+84)
|
||||
#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+246+186+156+172+36+28+84)
|
||||
|
||||
#define Act_MAX_ACTION_COD 1579
|
||||
#define Act_MAX_ACTION_COD 1580
|
||||
|
||||
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 20
|
||||
|
||||
|
@ -1096,8 +1096,9 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
|
|||
|
||||
#define ActLstDupUsr (ActChgNumRowFooGrp+153)
|
||||
#define ActLstSimUsr (ActChgNumRowFooGrp+154)
|
||||
#define ActRemDupUsr (ActChgNumRowFooGrp+155)
|
||||
|
||||
#define ActLstClk (ActChgNumRowFooGrp+155)
|
||||
#define ActLstClk (ActChgNumRowFooGrp+156)
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************************** Social tab *********************************/
|
||||
|
|
|
@ -129,13 +129,17 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.226.1 (2016-06-17)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.226.2 (2016-06-17)"
|
||||
#define CSS_FILE "swad15.226.css"
|
||||
#define JS_FILE "swad15.226.js"
|
||||
|
||||
// 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.226.2: Jun 17, 2016 New action to remove a user from list of possible duplicate users. (202921 lines)
|
||||
1 change necessary in database:
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1580','es','N','Quitar de usuarios duplicados');
|
||||
|
||||
Version 15.226.1: Jun 17, 2016 Changed layout of listing of similar users. (202887 lines)
|
||||
Version 15.226: Jun 17, 2016 Fixed bug in photo zoom. (202870 lines)
|
||||
Version 15.225.21:Jun 17, 2016 Fixed bug in photo zoom, reported by Javier Fernández Baldomero. (202894 lines)
|
||||
|
|
|
@ -63,7 +63,9 @@ extern struct Globals Gbl;
|
|||
/***************************** Private prototypes ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static bool Usr_CheckIfUsrIsDup (long UsrCod);
|
||||
static void Dup_ListSimilarUsrsInternal (void);
|
||||
|
||||
static bool Dup_CheckIfUsrIsDup (long UsrCod);
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Report a user as possible duplicate ********************/
|
||||
|
@ -233,12 +235,24 @@ void Dup_ListDuplicateUsrs (void)
|
|||
/*****************************************************************************/
|
||||
|
||||
void Dup_ListSimilarUsrs (void)
|
||||
{
|
||||
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
||||
|
||||
/***** Get user to be removed from list of possible duplicates *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
Dup_ListSimilarUsrsInternal ();
|
||||
}
|
||||
else
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
|
||||
}
|
||||
|
||||
static void Dup_ListSimilarUsrsInternal (void)
|
||||
{
|
||||
extern const char *Txt_Possibly_duplicate_users;
|
||||
extern const char *Txt_Informants;
|
||||
extern const char *Txt_Similar_users;
|
||||
extern const char *Txt_No_users_found[Rol_NUM_ROLES];
|
||||
struct UsrData UsrDatFromForm;
|
||||
struct UsrData UsrDat;
|
||||
char Query[256];
|
||||
MYSQL_RES *mysql_res;
|
||||
|
@ -246,9 +260,6 @@ void Dup_ListSimilarUsrs (void)
|
|||
unsigned NumUsrs;
|
||||
unsigned NumUsr;
|
||||
|
||||
/***** Get user's code *****/
|
||||
Usr_GetParamOtherUsrCodEncrypted (&UsrDatFromForm);
|
||||
|
||||
/***** Start frame with list of possible duplicate users *****/
|
||||
Lay_StartRoundFrame (NULL,Txt_Possibly_duplicate_users,NULL);
|
||||
|
||||
|
@ -256,7 +267,7 @@ void Dup_ListSimilarUsrs (void)
|
|||
sprintf (Query,"SELECT DISTINCT UsrCod FROM usr_IDs"
|
||||
" WHERE usr_IDs.UsrID IN"
|
||||
" (SELECT UsrID FROM usr_IDs WHERE UsrCod='%ld')",
|
||||
UsrDatFromForm.UsrCod);
|
||||
Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||
NumUsrs = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get similar users");
|
||||
|
||||
/***** List possible duplicated users *****/
|
||||
|
@ -327,9 +338,9 @@ void Dup_ListSimilarUsrs (void)
|
|||
Act_FormEnd ();
|
||||
|
||||
/* Button to remove from list of possible duplicate users */
|
||||
if (Usr_CheckIfUsrIsDup (UsrDat.UsrCod))
|
||||
if (Dup_CheckIfUsrIsDup (UsrDat.UsrCod))
|
||||
{
|
||||
Act_FormStart (ActLstSimUsr); // TODO: Change to a new action
|
||||
Act_FormStart (ActRemDupUsr);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat.EncryptedUsrCod);
|
||||
Lay_PutConfirmButtonInline ("No es duplicado"); // TODO: Need translation!!!
|
||||
Act_FormEnd ();
|
||||
|
@ -359,7 +370,7 @@ void Dup_ListSimilarUsrs (void)
|
|||
/********** Check if a user is in list of possible duplicate users ***********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static bool Usr_CheckIfUsrIsDup (long UsrCod)
|
||||
static bool Dup_CheckIfUsrIsDup (long UsrCod)
|
||||
{
|
||||
char Query[128];
|
||||
|
||||
|
@ -369,7 +380,28 @@ static bool Usr_CheckIfUsrIsDup (long UsrCod)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Remove a request for enrollment ***********************/
|
||||
/*********** Remove user from list of possible duplicate users ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Dup_RemoveUsrFromListDupUsrs (void)
|
||||
{
|
||||
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
||||
|
||||
/***** Get user to be removed from list of possible duplicates *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
/* Remove entry from database */
|
||||
Dup_RemoveUsrFromDuplicated (Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||
|
||||
/* Show list of similar users again */
|
||||
Dup_ListSimilarUsrsInternal ();
|
||||
}
|
||||
else
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******* Remove user from list of possible duplicate users in database *******/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Dup_RemoveUsrFromDuplicated (long UsrCod)
|
||||
|
|
|
@ -40,9 +40,13 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
void Dup_ReportUsrAsPossibleDuplicate (void);
|
||||
|
||||
void Dup_PutLinkToListDupUsrs (void);
|
||||
void Dup_ListDuplicateUsrs (void);
|
||||
|
||||
void Dup_ListSimilarUsrs (void);
|
||||
|
||||
void Dup_RemoveUsrFromListDupUsrs (void);
|
||||
void Dup_RemoveUsrFromDuplicated (long UsrCod);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user