Version 17.6

This commit is contained in:
Antonio Cañas Vargas 2017-09-22 14:12:05 +02:00
parent 64f7fe2053
commit 391ce45801
3 changed files with 170 additions and 30 deletions

View File

@ -252,14 +252,25 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 17.5.10 (2017-09-22)"
#define Log_PLATFORM_VERSION "SWAD 17.6 (2017-09-22)"
#define CSS_FILE "swad17.0.css"
#define JS_FILE "swad16.206.3.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 17.5.10: Sep 22, 2017 Actions to remove user from project. Not finished. (? lines)
Version 17.6: Sep 22, 2017 Actions to remove user from project. (230559 lines)
6 changes necessary in database:
UPDATE actions SET Txt='Solicitar ID añadir evaluador a proyecto' WHERE ActCod='1686' AND Language='es';
UPDATE actions SET Txt='Añadir evaluador a proyecto' WHERE ActCod='1689' AND Language='es';
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1690','es','N','Solicitar ID eliminar estudiante de proyecto');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1691','es','N','Solicitar ID eliminar tutor de proyecto');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1692','es','N','Solicitar ID eliminar evaluador de proyecto');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1693','es','N','Eliminar estudiante de proyecto');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1694','es','N','Eliminar tutor de proyecto');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1695','es','N','Eliminar evaluador de proyecto');
Version 17.5.10: Sep 22, 2017 Actions to remove user from project. Not finished. (230429 lines)
Version 17.5.9: Sep 22, 2017 Icon to remove user from project. (230350 lines)
Version 17.5.8: Sep 22, 2017 Name of department in listing of projects. (230336 lines)
Version 17.5.7: Sep 21, 2017 Selector for department in edition of a project. (230363 lines)

View File

@ -99,6 +99,7 @@ static void Prj_WriteUsrs (long PrjCod,Prj_ProjectView_t ProjectView,
static void Prj_ReqAnotherUsrID (Prj_RoleInProject_t RoleInProject);
static void Prj_AddUsrToProject (Prj_RoleInProject_t RoleInProject);
static void Prj_ReqRemUsrFromPrj (Prj_RoleInProject_t RoleInProject);
static bool Prj_CheckIfICanRemUsrFromPrj (void);
static void Prj_GetParamPrjOrder (void);
@ -617,7 +618,6 @@ static void Prj_WriteUsrs (long PrjCod,Prj_ProjectView_t ProjectView,
unsigned NumUsrsKnown;
unsigned NumUsrsUnknown;
unsigned NumUsrsToShow;
struct UsrData UsrDat;
bool UsrValid;
bool ShowPhoto;
char PhotoURL[PATH_MAX + 1];
@ -664,9 +664,6 @@ static void Prj_WriteUsrs (long PrjCod,Prj_ProjectView_t ProjectView,
/***** How many users will be shown? *****/
NumUsrsToShow = NumUsrsKnown;
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
/***** Write known users *****/
for (NumUsr = 0;
NumUsr < NumUsrsToShow;
@ -674,10 +671,10 @@ static void Prj_WriteUsrs (long PrjCod,Prj_ProjectView_t ProjectView,
{
/* Get user's code */
row = mysql_fetch_row (mysql_res);
UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]);
Gbl.Usrs.Other.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]);
/* Get user's data */
UsrValid = Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
UsrValid = Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat);
/* Start row for this user */
fprintf (Gbl.F.Out,"<tr>");
@ -695,17 +692,17 @@ static void Prj_WriteUsrs (long PrjCod,Prj_ProjectView_t ProjectView,
/* Put user's photo */
fprintf (Gbl.F.Out,"<td class=\"CENTER_TOP\" style=\"width:30px;\">");
ShowPhoto = (UsrValid ? Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL) :
ShowPhoto = (UsrValid ? Pho_ShowingUsrPhotoIsAllowed (&Gbl.Usrs.Other.UsrDat,PhotoURL) :
false);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
Pho_ShowUsrPhoto (&Gbl.Usrs.Other.UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM,false);
/* Write user's name */
fprintf (Gbl.F.Out,"</td>"
"<td class=\"AUTHOR_TXT LEFT_MIDDLE\">");
if (UsrValid)
fprintf (Gbl.F.Out,"%s",UsrDat.FullName);
fprintf (Gbl.F.Out,"%s",Gbl.Usrs.Other.UsrDat.FullName);
else
fprintf (Gbl.F.Out,"[%s]",
Txt_ROLES_SINGUL_abc[Rol_UNK][Usr_SEX_UNKNOWN]); // User not found, likely a user who has been removed
@ -725,9 +722,6 @@ static void Prj_WriteUsrs (long PrjCod,Prj_ProjectView_t ProjectView,
(NumUsrsUnknown == 1) ?
Txt_ROLES_SINGUL_abc[Rol_UNK][Usr_SEX_UNKNOWN] :
Txt_ROLES_PLURAL_abc[Rol_UNK][Usr_SEX_UNKNOWN]);
/***** Free memory used for user's data *****/
Usr_UsrDataDestructor (&UsrDat);
}
/***** Row to add a new user *****/
@ -886,21 +880,26 @@ static void Prj_AddUsrToProject (Prj_RoleInProject_t RoleInProject)
void Prj_ReqRemStd (void)
{
Prj_ReqAnotherUsrID (Prj_ROLE_STD);
Prj_ReqRemUsrFromPrj (Prj_ROLE_STD);
}
void Prj_ReqRemTut (void)
{
Prj_ReqAnotherUsrID (Prj_ROLE_TUT);
Prj_ReqRemUsrFromPrj (Prj_ROLE_TUT);
}
void Prj_ReqRemEva (void)
{
Prj_ReqAnotherUsrID (Prj_ROLE_EVA);
Prj_ReqRemUsrFromPrj (Prj_ROLE_EVA);
}
static void Prj_ReqRemUsrFromPrj (Prj_RoleInProject_t RoleInProject)
{
extern const char *Txt_Do_you_really_want_to_be_removed_from_the_project_X;
extern const char *Txt_Do_you_really_want_to_remove_the_following_user_from_the_project_X;
extern const char *Txt_Remove_me_from_this_project;
extern const char *Txt_Remove_user_from_this_project;
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
static Act_Action_t ActionRemUsr[Prj_NUM_ROLES_IN_PROJECT] =
{
ActUnk, // Prj_ROLE_UNK, Unknown
@ -908,6 +907,50 @@ static void Prj_ReqRemUsrFromPrj (Prj_RoleInProject_t RoleInProject)
ActRemTutPrj, // Prj_ROLE_TUT, Tutor
ActRemEvaPrj, // Prj_ROLE_EVA, Evaluator
};
bool ItsMe;
/***** Get user to be removed *****/
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
{
if (Prj_CheckIfICanRemUsrFromPrj ())
{
ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod);
/***** Show question and button to remove user as administrator *****/
/* Start alert */
sprintf (Gbl.Alert.Txt,
ItsMe ? Txt_Do_you_really_want_to_be_removed_from_the_project_X :
Txt_Do_you_really_want_to_remove_the_following_user_from_the_project_X,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
/* Show user's record */
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
/* Show form to request confirmation */
Act_FormStart (ActionRemUsr[RoleInProject]);
Usr_PutParamUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod);
Btn_PutRemoveButton (ItsMe ? Txt_Remove_me_from_this_project :
Txt_Remove_user_from_this_project);
Act_FormEnd ();
/* End alert */
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,NULL,Btn_NO_BUTTON,NULL);
}
else
Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
}
else
Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
}
/*****************************************************************************/
/*********** Check if I can remove another user in current course ************/
/*****************************************************************************/
static bool Prj_CheckIfICanRemUsrFromPrj (void)
{
return true; // TODO: Rewrite this function
}
/*****************************************************************************/
@ -995,6 +1038,8 @@ static void Prj_PutParams (void)
Prj_PutParamPrjCod (Gbl.Prjs.PrjCodToEdit);
Prj_PutHiddenParamPrjOrder ();
Pag_PutHiddenParamPagNum (Pag_PROJECTS,Gbl.Prjs.CurrentPage);
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
Usr_PutParamOtherUsrCodEncrypted ();
}
/*****************************************************************************/

View File

@ -8999,6 +8999,27 @@ const char *Txt_Do_you_really_want_to_be_removed_from_the_course_X = // Warning:
" (removing your works, enrolment in groups, etc.)?"; // Necessita de tradução
#endif
const char *Txt_Do_you_really_want_to_be_removed_from_the_project_X = // Warning: it is very important to include %s in the following sentences
#if L==1
"&iquest;De veres voleu ser eliminat del projecte <strong>%s</strong>?";
#elif L==2
"M&ouml;chten Sie wirklich aus dem Projekt <strong>%s</strong> entfernt werden?";
#elif L==3
"Do you really want to be removed from the project <strong>%s</strong>";
#elif L==4
"&iquest;Realmente desea ser eliminado del proyecto <strong>%s</strong>?";
#elif L==5
"Voulez-vous vraiment &ecirc;tre retir&eacute; du projet <strong>%s</strong>?";
#elif L==6
"&iquest;Realmente desea ser eliminado del proyecto <strong>%s</strong>?"; // Okoteve traducción
#elif L==7
"Vuoi realmente rimuovere dal progetto <strong>%s</strong>?";
#elif L==8
"Czy naprawd&eogon; chcesz zosta&cacute; usuni&eogon;ty z projektu <strong>%s</strong>?";
#elif L==9
"Voc&ecirc; realmente quer ser removido do projeto <strong>%s</strong>?";
#endif
const char *Txt_Do_you_really_want_to_completely_eliminate_the_following_user =
#if L==1
"&iquest;Realmente desea eliminar completamente la cuenta del siguiente usuario?"; // Necessita traduccio
@ -9578,16 +9599,16 @@ const char *Txt_Do_you_really_want_to_remove_the_following_user_as_an_administra
" jako administratora <strong>%s</strong>?";
#elif L==9
"Do you really want to remove the following user"
" as an administrator of <strong>%s</strong>?"; // Necessita de tradução
" as an administrator of <strong>%s</strong>?"; // Necessita de tradução
#endif
const char *Txt_Do_you_really_want_to_remove_the_following_user_from_the_course_X = // Warning: it is very important to include %s in the following sentences
#if L==1
"&iquest;Realmente desea eliminar el siguiente usuario de la asignatura <strong>%s</strong>"
" (eliminando sus trabajos, adscripci&oacute;n a grupos, etc.)?"; // Necessita traduccio
"&iquest;De veres voleu eliminar el seg&uuml;ent usuari de l'assignatura <strong>%s</strong>"
" (eliminant els seus treballs, adscripci&oacute; a grups, etc.)?";
#elif L==2
"Do you really want to remove the following user from the course <strong>%s</strong>"
" (removing her/his works, enrolment in groups, etc.)?"; // Need Übersetzung
"M&ouml;chten Sie den folgenden Benutzer wirklich aus dem Kurs <strong>%s</strong> entfernen"
" (Beseitigung ihrer Werke, Einschreibung in Gruppen usw.)?";
#elif L==3
"Do you really want to remove the following user from the course <strong>%s</strong>"
" (removing her/his works, enrolment in groups, etc.)?";
@ -9595,8 +9616,8 @@ const char *Txt_Do_you_really_want_to_remove_the_following_user_from_the_course_
"&iquest;Realmente desea eliminar el siguiente usuario de la asignatura <strong>%s</strong>"
" (eliminando sus trabajos, adscripci&oacute;n a grupos, etc.)?";
#elif L==5
"Do you really want to remove the following user from the course <strong>%s</strong>"
" (removing her/his works, enrolment in groups, etc.)?"; // Besoin de traduction
"Voulez-vous vraiment supprimer l'utilisateur suivant de la mati&egrave;re <strong>%s</strong>"
" (&eacute;liminant ses travaux, inscription en groupes, etc.)?";
#elif L==6
"&iquest;Realmente desea eliminar el siguiente usuario de la asignatura <strong>%s</strong>"
" (eliminando sus trabajos, adscripci&oacute;n a grupos, etc.)?"; // Okoteve traducción
@ -9604,11 +9625,32 @@ const char *Txt_Do_you_really_want_to_remove_the_following_user_from_the_course_
"Vuoi realmente rimuovere il seguente utente dal corso <strong>%s</strong>"
" (rimuovendo i suoi lavori, registrazione in gruppi, etc.)?";
#elif L==8
"Do you really want to remove the following user z kursu <strong>%s</strong>"
" (removing her/his works, enrolment in groups, etc.)?";
"Czy na pewno chcesz usun&aogon;&cacute; nast&eogon;puj&aogon;cy u&zdot;ytkownik z kursu <strong>%s</strong>"
" (usuni&eogon;cie jego utwor&oacute;w, zapisanie si&eogon; w grupach itp.)?";
#elif L==9
"Do you really want to remove the following user from the course <strong>%s</strong>"
" (removing her/his works, enrolment in groups, etc.)?"; // Necessita de tradução
"Voc&ecirc; deseja realmente remover o seguinte usu&aacute;rio da disciplina <strong>%s</strong>"
" (removendo seus trabalhos, inscri&ccedil;&atilde;o em grupos, etc.)?";
#endif
const char *Txt_Do_you_really_want_to_remove_the_following_user_from_the_project_X = // Warning: it is very important to include %s in the following sentences
#if L==1
"&iquest;De veres voleu eliminar el seg&uuml;ent usuari del projecte <strong>%s</strong>?";
#elif L==2
"M&ouml;chten Sie den folgenden Benutzer wirklich aus dem Projekt <strong>%s</strong> entfernen?";
#elif L==3
"Do you really want to remove the following user from the project <strong>%s</strong>";
#elif L==4
"&iquest;Realmente desea eliminar el siguiente usuario del proyecto <strong>%s</strong>?";
#elif L==5
"Voulez-vous vraiment supprimer l'utilisateur suivant du projet <strong>%s</strong>?";
#elif L==6
"&iquest;Realmente desea eliminar el siguiente usuario del proyecto <strong>%s</strong>?"; // Okoteve traducción
#elif L==7
"Vuoi realmente rimuovere il seguente utente dal progetto <strong>%s</strong>?";
#elif L==8
"Czy na pewno chcesz usun&aogon;&cacute; nast&eogon;puj&aogon;cy u&zdot;ytkownik z projekt <strong>%s</strong>?";
#elif L==9
"Voc&ecirc; deseja realmente remover o seguinte usu&aacute;rio do projeto <strong>%s</strong>?";
#endif
const char *Txt_Do_you_really_want_to_remove_the_game_X = // Warning: it is very important to include %s in the following sentences
@ -32367,6 +32409,27 @@ const char *Txt_Remove_me_from_this_course =
"Tirar me desta disciplina";
#endif
const char *Txt_Remove_me_from_this_project =
#if L==1
"Eliminarme d'aquest projecte";
#elif L==2
"Entfernen Sie diesen Projekt";
#elif L==3
"Remove me from this project";
#elif L==4
"Eliminarme de este proyecto";
#elif L==5
"Enlever-moi de ce projet";
#elif L==6
"Eliminarme de este proyecto"; // Okoteve traducción
#elif L==7
"Rimuovimi da questo progetto";
#elif L==8
"Usu&ntilde; z projekt";
#elif L==9
"Tirar me deste projeto";
#endif
const char *Txt_Remove_me_from_the_course_X = // Warning: it is very important to include %s in the following sentences
#if L==1
"Eliminarme de l'assignatura <strong>%s</strong>";
@ -32619,6 +32682,27 @@ const char *Txt_Remove_user_from_this_course =
"Tirar utilizador desta disciplina";
#endif
const char *Txt_Remove_user_from_this_project =
#if L==1
"Eliminar usuari d'aquest projecte";
#elif L==2
"Entfernen Benutzer Sie diesen Projekt";
#elif L==3
"Remove user from this project";
#elif L==4
"Eliminar usuario de este proyecto";
#elif L==5
"Enlever utilisateur de ce projet";
#elif L==6
"Eliminar usuario de este proyecto"; // Okoteve traducción
#elif L==7
"Rimuovi utente da questo progetto";
#elif L==8
"Usu&ntilde; u&zdot;ytkownika z projekt";
#elif L==9
"Tirar utilizador deste projeto";
#endif
const char *Txt_Remove_USER_as_an_administrator =
#if L==1
"Eliminar com a administrador/a";
@ -46653,7 +46737,7 @@ const char *Txt_The_plugin_X_has_been_renamed_as_Y = // Warning: it is very impo
const char *Txt_The_project_has_been_modified =
#if L==1
"L'activitat ha estat modificada.";
"El projecte ha estat modificada.";
#elif L==2
"Die Projekt wurde ge&auml;ndert.";
#elif L==3