mirror of
https://github.com/acanas/swad-core.git
synced 2024-09-20 00:02:42 +02:00
Version 24.2: Sep 17, 2024 Use users' clipboard in enrolment of several users.
This commit is contained in:
parent
356976a3fb
commit
67e48c9efd
|
@ -2493,13 +2493,13 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
|
||||||
.USR_LIST_NUM_N_DARK {color:#e0e0e0; font-size:15pt; font-weight:bold;}
|
.USR_LIST_NUM_N_DARK {color:#e0e0e0; font-size:15pt; font-weight:bold;}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
.TITLE_WHITE {color:#505050; font-size:18pt;}
|
.TITLE_WHITE {color:#505050; font-size:18pt; padding:12px 0 6px 0;}
|
||||||
.TITLE_GREY {color:#505050; font-size:18pt;}
|
.TITLE_GREY {color:#505050; font-size:18pt; padding:12px 0 6px 0;}
|
||||||
.TITLE_PURPLE {color:#573c4d; font-size:18pt;}
|
.TITLE_PURPLE {color:#573c4d; font-size:18pt; padding:12px 0 6px 0;}
|
||||||
.TITLE_BLUE {color:#4d88a1; font-size:18pt;}
|
.TITLE_BLUE {color:#4d88a1; font-size:18pt; padding:12px 0 6px 0;}
|
||||||
.TITLE_YELLOW {color:#7c4d2a; font-size:18pt;}
|
.TITLE_YELLOW {color:#7c4d2a; font-size:18pt; padding:12px 0 6px 0;}
|
||||||
.TITLE_PINK {color:#63474e; font-size:18pt;}
|
.TITLE_PINK {color:#63474e; font-size:18pt; padding:12px 0 6px 0;}
|
||||||
.TITLE_DARK {color:#505050; font-size:18pt;}
|
.TITLE_DARK {color:#505050; font-size:18pt; padding:12px 0 6px 0;}
|
||||||
|
|
||||||
/*********************** Icon and checkbox highlighting **********************/
|
/*********************** Icon and checkbox highlighting **********************/
|
||||||
.ICO_HIDDEN
|
.ICO_HIDDEN
|
||||||
|
|
|
@ -633,10 +633,11 @@ Me sale este error, no s
|
||||||
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 24.1 (2024-09-17)"
|
#define Log_PLATFORM_VERSION "SWAD 24.2 (2024-09-17)"
|
||||||
#define CSS_FILE "swad24.1.css"
|
#define CSS_FILE "swad24.1.css"
|
||||||
#define JS_FILE "swad23.89.js"
|
#define JS_FILE "swad23.89.js"
|
||||||
/*
|
/*
|
||||||
|
Version 24.2: Sep 17, 2024 Use users' clipboard in enrolment of several users. (335897 lines)
|
||||||
Version 24.1: Sep 17, 2024 New options to copy users. (335857 lines)
|
Version 24.1: Sep 17, 2024 New options to copy users. (335857 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
CREATE TABLE IF NOT EXISTS usr_clipboards (UsrCod INT NOT NULL,OthUsrCod INT NOT NULL,CopyTime TIMESTAMP,UNIQUE INDEX(UsrCod,OthUsrCod),INDEX(CopyTime));
|
CREATE TABLE IF NOT EXISTS usr_clipboards (UsrCod INT NOT NULL,OthUsrCod INT NOT NULL,CopyTime TIMESTAMP,UNIQUE INDEX(UsrCod,OthUsrCod),INDEX(CopyTime));
|
||||||
|
|
104
swad_enrolment.c
104
swad_enrolment.c
|
@ -69,6 +69,7 @@
|
||||||
#include "swad_setting_database.h"
|
#include "swad_setting_database.h"
|
||||||
#include "swad_test_print.h"
|
#include "swad_test_print.h"
|
||||||
#include "swad_user.h"
|
#include "swad_user.h"
|
||||||
|
#include "swad_user_clipboard.h"
|
||||||
#include "swad_user_database.h"
|
#include "swad_user_database.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -109,6 +110,7 @@ static void Enr_NotifyAfterEnrolment (const struct Usr_Data *UsrDat,
|
||||||
static void Enr_ReqAdminUsrs (Rol_Role_t Role);
|
static void Enr_ReqAdminUsrs (Rol_Role_t Role);
|
||||||
static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role);
|
static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role);
|
||||||
static void Enr_PutAreaToEnterUsrsIDs (void);
|
static void Enr_PutAreaToEnterUsrsIDs (void);
|
||||||
|
static void Enr_PutUsrsClipboard (void);
|
||||||
static void Enr_PutActionsRegRemSeveralUsrs (void);
|
static void Enr_PutActionsRegRemSeveralUsrs (void);
|
||||||
|
|
||||||
static void Enr_ReceiveUsrsCrs (Rol_Role_t Role);
|
static void Enr_ReceiveUsrsCrs (Rol_Role_t Role);
|
||||||
|
@ -541,7 +543,6 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
|
||||||
extern const char *Txt_Administer_multiple_non_editing_teachers;
|
extern const char *Txt_Administer_multiple_non_editing_teachers;
|
||||||
extern const char *Txt_Administer_multiple_teachers;
|
extern const char *Txt_Administer_multiple_teachers;
|
||||||
extern const char *Txt_Step_1_Provide_a_list_of_users;
|
extern const char *Txt_Step_1_Provide_a_list_of_users;
|
||||||
extern const char *Txt_Type_or_paste_a_list_of_IDs_nicks_or_emails_;
|
|
||||||
extern const char *Txt_Step_2_Select_the_desired_action;
|
extern const char *Txt_Step_2_Select_the_desired_action;
|
||||||
extern const char *Txt_Step_3_Optionally_select_groups;
|
extern const char *Txt_Step_3_Optionally_select_groups;
|
||||||
extern const char *Txt_Select_the_groups_in_from_which_you_want_to_register_remove_users_;
|
extern const char *Txt_Select_the_groups_in_from_which_you_want_to_register_remove_users_;
|
||||||
|
@ -606,8 +607,10 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
|
||||||
HTM_Txt (Txt_Step_1_Provide_a_list_of_users);
|
HTM_Txt (Txt_Step_1_Provide_a_list_of_users);
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
|
|
||||||
Ale_ShowAlert (Ale_INFO,Txt_Type_or_paste_a_list_of_IDs_nicks_or_emails_);
|
HTM_TABLE_BeginCenterPadding (2);
|
||||||
Enr_PutAreaToEnterUsrsIDs ();
|
Enr_PutAreaToEnterUsrsIDs ();
|
||||||
|
Enr_PutUsrsClipboard ();
|
||||||
|
HTM_TABLE_End ();
|
||||||
|
|
||||||
/***** Step 2: Put different actions to register/remove users to/from current course *****/
|
/***** Step 2: Put different actions to register/remove users to/from current course *****/
|
||||||
HTM_DIV_Begin ("class=\"TITLE_%s LM\"",The_GetSuffix ());
|
HTM_DIV_Begin ("class=\"TITLE_%s LM\"",The_GetSuffix ());
|
||||||
|
@ -779,9 +782,9 @@ void Enr_RemoveOldUsrs (void)
|
||||||
static void Enr_PutAreaToEnterUsrsIDs (void)
|
static void Enr_PutAreaToEnterUsrsIDs (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_List_of_nicks_emails_or_IDs;
|
extern const char *Txt_List_of_nicks_emails_or_IDs;
|
||||||
|
extern const char *Txt_The_nicks_emails_or_IDs_can_be_separated_;
|
||||||
|
|
||||||
/***** Text area for users' IDs *****/
|
/***** Text area for users' IDs *****/
|
||||||
HTM_TABLE_BeginCenterPadding (2);
|
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
/* Label */
|
/* Label */
|
||||||
|
@ -791,13 +794,57 @@ static void Enr_PutAreaToEnterUsrsIDs (void)
|
||||||
HTM_TD_Begin ("class=\"LT\"");
|
HTM_TD_Begin ("class=\"LT\"");
|
||||||
HTM_TEXTAREA_Begin (HTM_NO_ATTR,
|
HTM_TEXTAREA_Begin (HTM_NO_ATTR,
|
||||||
"id=\"UsrsIDs\" name=\"UsrsIDs\""
|
"id=\"UsrsIDs\" name=\"UsrsIDs\""
|
||||||
|
" placeholder=\"%s\""
|
||||||
" cols=\"60\" rows=\"10\" class=\"INPUT_%s\"",
|
" cols=\"60\" rows=\"10\" class=\"INPUT_%s\"",
|
||||||
|
Txt_The_nicks_emails_or_IDs_can_be_separated_,
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
HTM_TEXTAREA_End ();
|
HTM_TEXTAREA_End ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
HTM_TABLE_End ();
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************************ Put current users' clipboard ***********************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Enr_PutUsrsClipboard (void)
|
||||||
|
{
|
||||||
|
extern const char *Txt_User_clipboard;
|
||||||
|
unsigned NumUsrs;
|
||||||
|
MYSQL_RES *mysql_res;
|
||||||
|
|
||||||
|
/***** Get and show users in clipboard *****/
|
||||||
|
NumUsrs = Usr_DB_GetUsrsInMyClipboard (&mysql_res);
|
||||||
|
|
||||||
|
/***** Users' clipboard *****/
|
||||||
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
|
/* Label */
|
||||||
|
Frm_LabelColumn ("RT","UseClipboard",Txt_User_clipboard);
|
||||||
|
|
||||||
|
/* Data */
|
||||||
|
HTM_TD_Begin ("class=\"LT\"");
|
||||||
|
|
||||||
|
/* Checkbox */
|
||||||
|
HTM_LABEL_Begin ("class=\"FORM_IN_%s\"",The_GetSuffix ());
|
||||||
|
HTM_INPUT_CHECKBOX ("UseClipboard",
|
||||||
|
NumUsrs ? HTM_NO_ATTR :
|
||||||
|
HTM_DISABLED,
|
||||||
|
"id=\"UseClipboard\" value=\"Y\"");
|
||||||
|
HTM_TxtF ("%u usuarios",NumUsrs); // TODO: Need translation!!!!!
|
||||||
|
HTM_LABEL_End ();
|
||||||
|
|
||||||
|
/* Clipboard */
|
||||||
|
if (NumUsrs)
|
||||||
|
UsrClp_ListUsrsInMyClipboard (NumUsrs,&mysql_res);
|
||||||
|
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
HTM_TR_End ();
|
||||||
|
|
||||||
|
/***** Free structure that stores the query result *****/
|
||||||
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -928,6 +975,10 @@ static void Enr_ReceiveUsrsCrs (Rol_Role_t Role)
|
||||||
bool ItLooksLikeAUsrID;
|
bool ItLooksLikeAUsrID;
|
||||||
Enr_RegRemUsrsAction_t RegRemUsrsAction;
|
Enr_RegRemUsrsAction_t RegRemUsrsAction;
|
||||||
bool SelectionIsValid = true;
|
bool SelectionIsValid = true;
|
||||||
|
bool UseClipboard;
|
||||||
|
unsigned NumUsrsInClipboard;
|
||||||
|
unsigned NumUsrInClipboard;
|
||||||
|
MYSQL_RES *mysql_res;
|
||||||
|
|
||||||
/***** Check the role of users to register / remove *****/
|
/***** Check the role of users to register / remove *****/
|
||||||
switch (Role)
|
switch (Role)
|
||||||
|
@ -952,6 +1003,9 @@ static void Enr_ReceiveUsrsCrs (Rol_Role_t Role)
|
||||||
if (!Pwd_GetConfirmationOnDangerousAction ())
|
if (!Pwd_GetConfirmationOnDangerousAction ())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/***** Get if users' clipboard will be used *****/
|
||||||
|
UseClipboard = Par_GetParBool ("UseClipboard");
|
||||||
|
|
||||||
/***** Get the action to do *****/
|
/***** Get the action to do *****/
|
||||||
WhatToDo.RemoveUsrs = false;
|
WhatToDo.RemoveUsrs = false;
|
||||||
WhatToDo.RemoveSpecifiedUsrs = false;
|
WhatToDo.RemoveSpecifiedUsrs = false;
|
||||||
|
@ -1040,6 +1094,10 @@ static void Enr_ReceiveUsrsCrs (Rol_Role_t Role)
|
||||||
|
|
||||||
if (SelectionIsValid)
|
if (SelectionIsValid)
|
||||||
{
|
{
|
||||||
|
/***** Get users' clipboard *****/
|
||||||
|
if (UseClipboard)
|
||||||
|
NumUsrsInClipboard = Usr_DB_GetUsrsInMyClipboard (&mysql_res);
|
||||||
|
|
||||||
/***** Get list of users' IDs *****/
|
/***** Get list of users' IDs *****/
|
||||||
if ((ListUsrsIDs = malloc (ID_MAX_BYTES_LIST_USRS_IDS + 1)) == NULL)
|
if ((ListUsrsIDs = malloc (ID_MAX_BYTES_LIST_USRS_IDS + 1)) == NULL)
|
||||||
Err_NotEnoughMemoryExit ();
|
Err_NotEnoughMemoryExit ();
|
||||||
|
@ -1137,6 +1195,21 @@ static void Enr_ReceiveUsrsCrs (Rol_Role_t Role)
|
||||||
Usr_FreeListUsrCods (&ListUsrCods);
|
Usr_FreeListUsrCods (&ListUsrCods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get users from clipboard */
|
||||||
|
if (UseClipboard)
|
||||||
|
for (NumUsrInClipboard = 0;
|
||||||
|
NumUsrInClipboard < NumUsrsInClipboard;
|
||||||
|
NumUsrInClipboard++)
|
||||||
|
{
|
||||||
|
UsrDat.UsrCod = DB_GetNextCode (mysql_res);
|
||||||
|
|
||||||
|
for (NumCurrentUsr = 0;
|
||||||
|
NumCurrentUsr < Gbl.Usrs.LstUsrs[Role].NumUsrs;
|
||||||
|
NumCurrentUsr++)
|
||||||
|
if (Gbl.Usrs.LstUsrs[Role].Lst[NumCurrentUsr].UsrCod == UsrDat.UsrCod) // User found
|
||||||
|
Gbl.Usrs.LstUsrs[Role].Lst[NumCurrentUsr].Remove = WhatToDo.RemoveSpecifiedUsrs;
|
||||||
|
}
|
||||||
|
|
||||||
/***** Loop 2: go through users list removing users *****/
|
/***** Loop 2: go through users list removing users *****/
|
||||||
for (NumCurrentUsr = 0;
|
for (NumCurrentUsr = 0;
|
||||||
NumCurrentUsr < Gbl.Usrs.LstUsrs[Role].NumUsrs;
|
NumCurrentUsr < Gbl.Usrs.LstUsrs[Role].NumUsrs;
|
||||||
|
@ -1257,11 +1330,31 @@ static void Enr_ReceiveUsrsCrs (Rol_Role_t Role)
|
||||||
/* Free memory used for list of users' codes found for this ID */
|
/* Free memory used for list of users' codes found for this ID */
|
||||||
Usr_FreeListUsrCods (&ListUsrCods);
|
Usr_FreeListUsrCods (&ListUsrCods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Register users in clipboard */
|
||||||
|
if (UseClipboard)
|
||||||
|
{
|
||||||
|
mysql_data_seek (mysql_res,0);
|
||||||
|
for (NumUsrInClipboard = 0;
|
||||||
|
NumUsrInClipboard < NumUsrsInClipboard;
|
||||||
|
NumUsrInClipboard++)
|
||||||
|
{
|
||||||
|
UsrDat.UsrCod = DB_GetNextCode (mysql_res);
|
||||||
|
Enr_RegisterUsr (&UsrDat,Role,&LstGrps,&NumUsrsRegistered);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free memory used for user's data *****/
|
/***** Free memory used for user's data *****/
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
|
||||||
|
/***** Free memory used by the list of user's IDs *****/
|
||||||
|
free (ListUsrsIDs);
|
||||||
|
|
||||||
|
/***** Free structure that stores the query result about users' clipboard *****/
|
||||||
|
if (UseClipboard)
|
||||||
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
if (NumUsrsEliminated)
|
if (NumUsrsEliminated)
|
||||||
/***** Move unused contents of messages to table of deleted contents of messages *****/
|
/***** Move unused contents of messages to table of deleted contents of messages *****/
|
||||||
Msg_DB_MoveUnusedMsgsContentToDeleted ();
|
Msg_DB_MoveUnusedMsgsContentToDeleted ();
|
||||||
|
@ -1312,9 +1405,6 @@ static void Enr_ReceiveUsrsCrs (Rol_Role_t Role)
|
||||||
NumUsrsRegistered);
|
NumUsrsRegistered);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free memory used by the list of user's IDs *****/
|
|
||||||
free (ListUsrsIDs);
|
|
||||||
}
|
}
|
||||||
else // Selection of groups not valid
|
else // Selection of groups not valid
|
||||||
Ale_ShowAlert (Ale_WARNING,Txt_In_a_type_of_group_with_single_enrolment_students_can_not_be_registered_in_more_than_one_group);
|
Ale_ShowAlert (Ale_WARNING,Txt_In_a_type_of_group_with_single_enrolment_students_can_not_be_registered_in_more_than_one_group);
|
||||||
|
|
216
swad_text.c
216
swad_text.c
|
@ -49448,6 +49448,80 @@ const char *Txt_The_nickname_matches_the_one_you_had_previously_registered =
|
||||||
"The nickname matches the one you had previously registered."; // Çeviri lazim!
|
"The nickname matches the one you had previously registered."; // Çeviri lazim!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char *Txt_The_nicks_emails_or_IDs_can_be_separated_ =
|
||||||
|
#if L==1 // ca
|
||||||
|
"Els @nicks, correus electrònics o IDs"
|
||||||
|
" es poden separar per cadenes arbitràries"
|
||||||
|
" (per exemple, noms, llocs, etc.)."
|
||||||
|
" Només es tindran en compte les paraules"
|
||||||
|
" que sembli @nicks, correus electrònics o IDs;"
|
||||||
|
" la resta del text s'ignorarà.";
|
||||||
|
#elif L==2 // de
|
||||||
|
"Die @nicks, E-Mails oder IDs"
|
||||||
|
" können durch beliebige Zeichenfolgen"
|
||||||
|
" (z. B. Namen, Orte usw.) getrennt werden."
|
||||||
|
" Nur die Wörter, die wie @nicks, E-Mails oder IDs aussehen,"
|
||||||
|
" werden berücksichtigt;"
|
||||||
|
" der Rest des Textes wird ignoriert.";
|
||||||
|
#elif L==3 // en
|
||||||
|
"The @nicks, emails or IDs"
|
||||||
|
" can be separated by arbitrary strings"
|
||||||
|
" (eg. names, places, etc.)."
|
||||||
|
" Only the words that seems @nicks, emails or IDs"
|
||||||
|
" will be taken into account;"
|
||||||
|
" the rest of the text will be ignored.";
|
||||||
|
#elif L==4 // es
|
||||||
|
"Los @apodos, correos o ID (DNI/cédulas)"
|
||||||
|
" pueden ir separados por cadenas de caracteres arbitrarias"
|
||||||
|
" (por ej. nombres, apellidos, espacios, etc.)."
|
||||||
|
" Solo se tendrán en cuenta aquellas palabras"
|
||||||
|
" que parezcan @apodos, correos o ID (DNI/cédulas);"
|
||||||
|
" el resto del texto se ignorará.";
|
||||||
|
#elif L==5 // fr
|
||||||
|
"Les @nicks, emails ou identifiants"
|
||||||
|
" peuvent être séparés par des chaînes arbitraires"
|
||||||
|
" (ex. noms, lieux, etc.)."
|
||||||
|
" Seuls les mots qui semblent @nicks, emails ou identifiants"
|
||||||
|
" seront pris en compte;"
|
||||||
|
" le reste du texte sera ignoré.";
|
||||||
|
#elif L==6 // gn
|
||||||
|
"Los @apodos, correos o ID (DNI/cédulas)"
|
||||||
|
" pueden ir separados por cadenas de caracteres arbitrarias"
|
||||||
|
" (por ej. nombres, apellidos, espacios, etc.)."
|
||||||
|
" Solo se tendrán en cuenta aquellas palabras"
|
||||||
|
" que parezcan @apodos, correos o ID (DNI/cédulas);"
|
||||||
|
" el resto del texto se ignorará."; // Okoteve traducción
|
||||||
|
#elif L==7 // it
|
||||||
|
"I @nome-utenti, emails o IDs"
|
||||||
|
" possono essere separati da caratteri arbitrari"
|
||||||
|
" (eg. nomi, luoghi, etc.)."
|
||||||
|
" Solo le parole che sembrano"
|
||||||
|
" @nome-utenti, emails o IDs"
|
||||||
|
" saranno presi in considerazione;"
|
||||||
|
" il resto del testo sarà ignorato.";
|
||||||
|
#elif L==8 // pl
|
||||||
|
"@nicki, e-maile lub ID"
|
||||||
|
" mogą być oddzielone dowolnymi ciągami"
|
||||||
|
" (np. nazwy, miejsca itp.)."
|
||||||
|
" Tylko słowa, które wyglądają jak @nick, e-maile lub ID,"
|
||||||
|
" będą brane pod uwagę;"
|
||||||
|
" reszta tekstu zostanie zignorowana.";
|
||||||
|
#elif L==9 // pt
|
||||||
|
"As @alcunhas, os emails ou os IDs"
|
||||||
|
" podem ser separados por strings arbitrárias"
|
||||||
|
" (por exemplo, nomes, lugares, etc.)."
|
||||||
|
" Apenas as palavras que parecem @alcunhas, emails ou IDs"
|
||||||
|
" ser%atilde;o levadas em conta;"
|
||||||
|
" o resto do texto será ignorado.";
|
||||||
|
#elif L==10 // tr
|
||||||
|
"The @nicks, emails or IDs"
|
||||||
|
" can be separated by arbitrary strings"
|
||||||
|
" (eg. names, places, etc.)."
|
||||||
|
" Only the words that seems @nicks, emails or IDs"
|
||||||
|
" will be taken into account;"
|
||||||
|
" the rest of the text will be ignored."; // Çeviri lazim!
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *Txt_The_number_of_editing_lines_in_the_record_field_X_has_not_changed = // Warning: it is very important to include %s in the following sentences
|
const char *Txt_The_number_of_editing_lines_in_the_record_field_X_has_not_changed = // Warning: it is very important to include %s in the following sentences
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"El nombre de línies d'edició"
|
"El nombre de línies d'edició"
|
||||||
|
@ -50197,30 +50271,7 @@ const char *Txt_The_session_has_expired =
|
||||||
#elif L==10 // tr
|
#elif L==10 // tr
|
||||||
"Oturumun süresi doldu."; // Çeviri lazim!
|
"Oturumun süresi doldu."; // Çeviri lazim!
|
||||||
#endif
|
#endif
|
||||||
/*
|
|
||||||
const char *Txt_The_set_of_questions_has_been_modified =
|
|
||||||
#if L==1 // ca
|
|
||||||
"El conjunt de preguntes ha estat modificat.";
|
|
||||||
#elif L==2 // de
|
|
||||||
"Der Satz von Fragen wurde geändert.";
|
|
||||||
#elif L==3 // en
|
|
||||||
"The set of questions has been modified.";
|
|
||||||
#elif L==4 // es
|
|
||||||
"El conjunto de preguntas ha sido modificado.";
|
|
||||||
#elif L==5 // fr
|
|
||||||
"L'ensemble de questions a été modifié.";
|
|
||||||
#elif L==6 // gn
|
|
||||||
"El conjunto de preguntas ha sido modificado."; // Okoteve traducción
|
|
||||||
#elif L==7 // it
|
|
||||||
"Il set di domande è stato modificato.";
|
|
||||||
#elif L==8 // pl
|
|
||||||
"Zestaw pytań został zmodyfikowany.";
|
|
||||||
#elif L==9 // pt
|
|
||||||
"O conjunto de perguntas foi modificado.";
|
|
||||||
#elif L==10 // tr
|
|
||||||
"Soru seti değiştirildi.";
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
const char *Txt_The_size_of_the_file_exceeds_the_maximum_allowed_X = // Warning: it is very important to include %s in the following sentences
|
const char *Txt_The_size_of_the_file_exceeds_the_maximum_allowed_X = // Warning: it is very important to include %s in the following sentences
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"La mida del fitxer"
|
"La mida del fitxer"
|
||||||
|
@ -54753,100 +54804,6 @@ const char *Txt_Type_of_group_X_removed = // Warning: it is very important to in
|
||||||
"Type of group <strong>%s</strong> removed."; // Çeviri lazim!
|
"Type of group <strong>%s</strong> removed."; // Çeviri lazim!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *Txt_Type_or_paste_a_list_of_IDs_nicks_or_emails_ =
|
|
||||||
#if L==1 // ca
|
|
||||||
"Escriviu o enganxeu una llista"
|
|
||||||
" de @nicks, correus electrònics o IDs."
|
|
||||||
" Els @nicks, correus electrònics o IDs"
|
|
||||||
" es poden separar per cadenes arbitràries"
|
|
||||||
" (per exemple, noms, llocs, etc.)."
|
|
||||||
" Només es tindran en compte les paraules"
|
|
||||||
" que sembli @nicks, correus electrònics o IDs;"
|
|
||||||
" la resta del text s'ignorarà.";
|
|
||||||
#elif L==2 // de
|
|
||||||
"Geben oder fügen Sie eine Liste"
|
|
||||||
" mit @nicks, E-Mails oder IDs ein."
|
|
||||||
" Die @nicks, E-Mails oder IDs"
|
|
||||||
" können durch beliebige Zeichenfolgen"
|
|
||||||
" (z. B. Namen, Orte usw.) getrennt werden."
|
|
||||||
" Nur die Wörter, die wie @nicks, E-Mails oder IDs aussehen,"
|
|
||||||
" werden berücksichtigt;"
|
|
||||||
" der Rest des Textes wird ignoriert.";
|
|
||||||
#elif L==3 // en
|
|
||||||
"Type or paste a list"
|
|
||||||
" of @nicks, emails or IDs."
|
|
||||||
" The @nicks, emails or IDs"
|
|
||||||
" can be separated by arbitrary strings"
|
|
||||||
" (eg. names, places, etc.)."
|
|
||||||
" Only the words that seems @nicks, emails or IDs"
|
|
||||||
" will be taken into account;"
|
|
||||||
" the rest of the text will be ignored.";
|
|
||||||
#elif L==4 // es
|
|
||||||
"Escriba o pegue una lista"
|
|
||||||
" con @apodos, correos o ID (DNI/cédulas)."
|
|
||||||
" Los @apodos, correos o ID (DNI/cédulas)"
|
|
||||||
" pueden ir separados por cadenas de caracteres arbitrarias"
|
|
||||||
" (por ej. nombres, apellidos, espacios, etc.)."
|
|
||||||
" Solo se tendrán en cuenta aquellas palabras"
|
|
||||||
" que parezcan @apodos, correos o ID (DNI/cédulas);"
|
|
||||||
" el resto del texto se ignorará.";
|
|
||||||
#elif L==5 // fr
|
|
||||||
"Tapez ou collez une liste"
|
|
||||||
" de @nicks, e-mails ou identifiants."
|
|
||||||
" Les @nicks, emails ou identifiants"
|
|
||||||
" peuvent être séparés par des chaînes arbitraires"
|
|
||||||
" (ex. noms, lieux, etc.)."
|
|
||||||
" Seuls les mots qui semblent @nicks, emails ou identifiants"
|
|
||||||
" seront pris en compte;"
|
|
||||||
" le reste du texte sera ignoré.";
|
|
||||||
#elif L==6 // gn
|
|
||||||
"Escriba o pegue una lista"
|
|
||||||
" con @apodos, correos o ID (DNI/cédulas)."
|
|
||||||
" Los @apodos, correos o ID (DNI/cédulas)"
|
|
||||||
" pueden ir separados por cadenas de caracteres arbitrarias"
|
|
||||||
" (por ej. nombres, apellidos, espacios, etc.)."
|
|
||||||
" Solo se tendrán en cuenta aquellas palabras"
|
|
||||||
" que parezcan @apodos, correos o ID (DNI/cédulas);"
|
|
||||||
" el resto del texto se ignorará."; // Okoteve traducción
|
|
||||||
#elif L==7 // it
|
|
||||||
"Scrivi o incolla la lista"
|
|
||||||
" di @nome-utenti, emails o IDs."
|
|
||||||
" I @nome-utenti, emails o IDs"
|
|
||||||
" possono essere separati da caratteri arbitrari"
|
|
||||||
" (eg. nomi, luoghi, etc.)."
|
|
||||||
" Solo le parole che sembrano"
|
|
||||||
" @nome-utenti, emails o IDs"
|
|
||||||
" saranno presi in considerazione;"
|
|
||||||
" il resto del testo sarà ignorato.";
|
|
||||||
#elif L==8 // pl
|
|
||||||
"Wpisz lub wklej listę"
|
|
||||||
" @nicków, e-maili lub ID."
|
|
||||||
" @nicki, e-maile lub ID"
|
|
||||||
" mogą być oddzielone dowolnymi ciągami"
|
|
||||||
" (np. nazwy, miejsca itp.)."
|
|
||||||
" Tylko słowa, które wyglądają jak @nick, e-maile lub ID,"
|
|
||||||
" będą brane pod uwagę;"
|
|
||||||
" reszta tekstu zostanie zignorowana.";
|
|
||||||
#elif L==9 // pt
|
|
||||||
"Digite ou cole uma lista"
|
|
||||||
" de @alcunhas, emails ou IDs."
|
|
||||||
" As @alcunhas, os emails ou os IDs"
|
|
||||||
" podem ser separados por strings arbitrárias"
|
|
||||||
" (por exemplo, nomes, lugares, etc.)."
|
|
||||||
" Apenas as palavras que parecem @alcunhas, emails ou IDs"
|
|
||||||
" ser%atilde;o levadas em conta;"
|
|
||||||
" o resto do texto será ignorado.";
|
|
||||||
#elif L==10 // tr
|
|
||||||
"Type or paste a list"
|
|
||||||
" of @nicks, emails or IDs."
|
|
||||||
" The @nicks, emails or IDs"
|
|
||||||
" can be separated by arbitrary strings"
|
|
||||||
" (eg. names, places, etc.)."
|
|
||||||
" Only the words that seems @nicks, emails or IDs"
|
|
||||||
" will be taken into account;"
|
|
||||||
" the rest of the text will be ignored."; // Çeviri lazim!
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char *Txt_Types_of_degree =
|
const char *Txt_Types_of_degree =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Tipus de titulació";
|
"Tipus de titulació";
|
||||||
|
@ -55826,6 +55783,29 @@ const char *Txt_user[Usr_NUM_SEXS] =
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char *Txt_User_clipboard =
|
||||||
|
#if L==1 // ca
|
||||||
|
"Portapapers d'usuaris";
|
||||||
|
#elif L==2 // de
|
||||||
|
"Zwischenablage der Benutzer";
|
||||||
|
#elif L==3 // en
|
||||||
|
"User clipboard";
|
||||||
|
#elif L==4 // es
|
||||||
|
"Portapapeles de usuarios";
|
||||||
|
#elif L==5 // fr
|
||||||
|
"Presse-papiers des utilisateurs";
|
||||||
|
#elif L==6 // gn
|
||||||
|
"Portapapeles de usuarios"; // Okoteve traducción
|
||||||
|
#elif L==7 // it
|
||||||
|
"Appunti degli utenti";
|
||||||
|
#elif L==8 // pl
|
||||||
|
"Schowek użytkownika";
|
||||||
|
#elif L==9 // pt
|
||||||
|
"Área de transferência de utilizadores";
|
||||||
|
#elif L==10 // tr
|
||||||
|
"Kullanıcı panosu";
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *Txt_USER_comments =
|
const char *Txt_USER_comments =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Observacions";
|
"Observacions";
|
||||||
|
|
|
@ -25,12 +25,14 @@
|
||||||
/*********************************** Headers *********************************/
|
/*********************************** Headers *********************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
// #include "swad_alert.h"
|
||||||
#include "swad_cryptography.h"
|
#include "swad_cryptography.h"
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
#include "swad_global.h"
|
#include "swad_global.h"
|
||||||
#include "swad_parameter.h"
|
#include "swad_parameter.h"
|
||||||
#include "swad_photo.h"
|
#include "swad_photo.h"
|
||||||
#include "swad_user.h"
|
#include "swad_user.h"
|
||||||
|
#include "swad_user_clipboard.h"
|
||||||
#include "swad_user_database.h"
|
#include "swad_user_database.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -64,7 +66,6 @@ extern struct Globals Gbl;
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void UsrClp_CopyUsrsToClipboard (void);
|
static void UsrClp_CopyUsrsToClipboard (void);
|
||||||
static void UsrClp_ListUsrsInMyClipboard (void);
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************** Copy selected users to clipboard ***********************/
|
/******************** Copy selected users to clipboard ***********************/
|
||||||
|
@ -87,9 +88,10 @@ void UsrClp_CopyTchsToClipboard (void)
|
||||||
|
|
||||||
static void UsrClp_CopyUsrsToClipboard (void)
|
static void UsrClp_CopyUsrsToClipboard (void)
|
||||||
{
|
{
|
||||||
unsigned NumUsr = 0;
|
unsigned NumUsrs;
|
||||||
const char *Ptr;
|
const char *Ptr;
|
||||||
struct Usr_Data UsrDat;
|
struct Usr_Data UsrDat;
|
||||||
|
MYSQL_RES *mysql_res;
|
||||||
|
|
||||||
/***** Remove my clipboard *****/
|
/***** Remove my clipboard *****/
|
||||||
Usr_DB_RemoveMyClipboard ();
|
Usr_DB_RemoveMyClipboard ();
|
||||||
|
@ -113,16 +115,8 @@ static void UsrClp_CopyUsrsToClipboard (void)
|
||||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat, // Get student's data from database
|
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat, // Get student's data from database
|
||||||
Usr_DONT_GET_PREFS,
|
Usr_DONT_GET_PREFS,
|
||||||
Usr_GET_ROLE_IN_CRS))
|
Usr_GET_ROLE_IN_CRS))
|
||||||
{
|
|
||||||
/* Check if this user has accepted
|
|
||||||
his/her inscription in the current course */
|
|
||||||
UsrDat.Accepted = Enr_CheckIfUsrHasAcceptedInCurrentCrs (&UsrDat);
|
|
||||||
|
|
||||||
/* Add user to clipboard */
|
/* Add user to clipboard */
|
||||||
Usr_DB_CopyToClipboard (UsrDat.UsrCod);
|
Usr_DB_CopyToClipboard (UsrDat.UsrCod);
|
||||||
|
|
||||||
NumUsr++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free memory used for user's data *****/
|
/***** Free memory used for user's data *****/
|
||||||
|
@ -131,19 +125,17 @@ static void UsrClp_CopyUsrsToClipboard (void)
|
||||||
/***** Free memory used by list of selected users' codes *****/
|
/***** Free memory used by list of selected users' codes *****/
|
||||||
Usr_FreeListsSelectedEncryptedUsrsCods (&Gbl.Usrs.Selected);
|
Usr_FreeListsSelectedEncryptedUsrsCods (&Gbl.Usrs.Selected);
|
||||||
|
|
||||||
/***** Show message *****/
|
/***** Get and show users in clipboard *****/
|
||||||
Ale_ShowAlert (NumUsr ? Ale_SUCCESS :
|
NumUsrs = Usr_DB_GetUsrsInMyClipboard (&mysql_res);
|
||||||
Ale_WARNING,
|
UsrClp_ListUsrsInMyClipboard (NumUsrs,&mysql_res);
|
||||||
"Usuarios copiados en el portapapeles: %u",NumUsr);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
UsrClp_ListUsrsInMyClipboard ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************* Show users in my clipboard ************************/
|
/************************* Show users in my clipboard ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void UsrClp_ListUsrsInMyClipboard (void)
|
void UsrClp_ListUsrsInMyClipboard (unsigned NumUsrs,MYSQL_RES **mysql_res)
|
||||||
{
|
{
|
||||||
static const char *ClassPhoto[PhoSha_NUM_SHAPES] =
|
static const char *ClassPhoto[PhoSha_NUM_SHAPES] =
|
||||||
{
|
{
|
||||||
|
@ -152,16 +144,10 @@ static void UsrClp_ListUsrsInMyClipboard (void)
|
||||||
[PhoSha_SHAPE_OVAL ] = "PHOTOO12x16",
|
[PhoSha_SHAPE_OVAL ] = "PHOTOO12x16",
|
||||||
[PhoSha_SHAPE_RECTANGLE] = "PHOTOR12x16",
|
[PhoSha_SHAPE_RECTANGLE] = "PHOTOR12x16",
|
||||||
};
|
};
|
||||||
unsigned NumUsrs;
|
|
||||||
unsigned NumUsr;
|
unsigned NumUsr;
|
||||||
struct Usr_Data UsrDat;
|
struct Usr_Data UsrDat;
|
||||||
MYSQL_RES *mysql_res;
|
|
||||||
|
|
||||||
/***** Get users who have faved/shared *****/
|
/***** Get users in clipboard *****/
|
||||||
NumUsrs = Usr_DB_GetUsrsInMyClipboard (&mysql_res);
|
|
||||||
|
|
||||||
if (NumUsrs)
|
|
||||||
{
|
|
||||||
HTM_DIV_Begin ("class=\"UsrClp_USRS\"");
|
HTM_DIV_Begin ("class=\"UsrClp_USRS\"");
|
||||||
|
|
||||||
/***** Initialize structure with user's data *****/
|
/***** Initialize structure with user's data *****/
|
||||||
|
@ -173,7 +159,7 @@ static void UsrClp_ListUsrsInMyClipboard (void)
|
||||||
NumUsr++)
|
NumUsr++)
|
||||||
{
|
{
|
||||||
/***** Get user's code *****/
|
/***** Get user's code *****/
|
||||||
UsrDat.UsrCod = DB_GetNextCode (mysql_res);
|
UsrDat.UsrCod = DB_GetNextCode (*mysql_res);
|
||||||
|
|
||||||
/***** Get user's data and show user's photo *****/
|
/***** Get user's data and show user's photo *****/
|
||||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,
|
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,
|
||||||
|
@ -197,7 +183,3 @@ static void UsrClp_ListUsrsInMyClipboard (void)
|
||||||
|
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
|
||||||
}
|
|
||||||
|
|
|
@ -43,4 +43,6 @@ void UsrClp_CopyGstsToClipboard (void);
|
||||||
void UsrClp_CopyStdsToClipboard (void);
|
void UsrClp_CopyStdsToClipboard (void);
|
||||||
void UsrClp_CopyTchsToClipboard (void);
|
void UsrClp_CopyTchsToClipboard (void);
|
||||||
|
|
||||||
|
void UsrClp_ListUsrsInMyClipboard (unsigned NumUsrs,MYSQL_RES **mysql_res);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user