Version 15.107.7

This commit is contained in:
Antonio Cañas Vargas 2016-01-11 09:59:36 +01:00
parent 60afd8f18d
commit 53d82b6f56
3 changed files with 56 additions and 49 deletions

View File

@ -116,18 +116,20 @@
// TODO: Increment one second after each refresh in social timeline?
// TODO: Include time of last comment in table social_timeline to display social publishings with new comments when refreshing
// TODO: Add a new type of visibility of profile "unknown". Keep the same for photos?
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.107.6 (2016-01-11)"
#define Log_PLATFORM_VERSION "SWAD 15.107.7 (2016-01-11)"
#define CSS_FILE "swad15.107.2.css"
#define JS_FILE "swad15.107.2.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.107.7: Jan 11, 2016 Show error message when trying to share a removed social note. (192284 lines)
Version 15.107.6: Jan 11, 2016 Show error message when trying to send a comment in a removed social note. (192276 lines)
Version 15.107.5: Jan 11, 2016 Check if a user can comment a social note. (192225 lines)
Version 15.107.4: Jan 11, 2016 Show separated social note at top when a new comment is added.

View File

@ -1996,7 +1996,7 @@ void Soc_ReceiveCommentUsr (void)
static void Soc_ReceiveComment (void)
{
extern const char *Txt_SOCIAL_PUBLISHING_Published;
extern const char *Txt_It_is_not_possible_to_publish_your_comment;
extern const char *Txt_The_original_post_no_longer_exists;
char Content[Cns_MAX_BYTES_LONG_TEXT+1];
char Query[128+Cns_MAX_BYTES_LONG_TEXT];
struct SocialPublishing SocPub;
@ -2046,7 +2046,7 @@ static void Soc_ReceiveComment (void)
}
}
else
Lay_ShowAlert (Lay_WARNING,Txt_It_is_not_possible_to_publish_your_comment);
Lay_ShowAlert (Lay_WARNING,Txt_The_original_post_no_longer_exists);
}
/*****************************************************************************/
@ -2115,6 +2115,7 @@ void Soc_ShareSocialNoteUsr (void)
static void Soc_ShareSocialNote (void)
{
extern const char *Txt_SOCIAL_PUBLISHING_Shared;
extern const char *Txt_The_original_post_no_longer_exists;
struct SocialNote SocNot;
struct SocialPublishing SocPub;
bool IAmTheAuthor;
@ -2127,32 +2128,37 @@ static void Soc_ShareSocialNote (void)
/***** Get data of social note *****/
Soc_GetDataOfSocialNoteByCod (&SocNot);
IAmTheAuthor = (SocNot.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod);
if (IAmTheAuthor)
IAmAPublisherOfThisSocNot = true;
else
IAmAPublisherOfThisSocNot = Soc_CheckIfNoteIsPublishedInTimelineByUsr (SocNot.NotCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
ICanShare = (Gbl.Usrs.Me.Logged &&
!IAmTheAuthor && // I am not the author
!IAmAPublisherOfThisSocNot); // I have not shared the note
if (ICanShare)
if (SocNot.NotCod > 0)
{
/***** Share (publish social note in timeline) *****/
SocPub.AuthorCod = SocNot.UsrCod;
SocPub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod;
SocPub.NotCod = SocNot.NotCod;
Soc_PublishSocialNoteInTimeline (&SocPub); // Set SocPub.PubCod
IAmTheAuthor = (SocNot.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod);
if (IAmTheAuthor)
IAmAPublisherOfThisSocNot = true;
else
IAmAPublisherOfThisSocNot = Soc_CheckIfNoteIsPublishedInTimelineByUsr (SocNot.NotCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
ICanShare = (Gbl.Usrs.Me.Logged &&
!IAmTheAuthor && // I am not the author
!IAmAPublisherOfThisSocNot); // I have not shared the note
if (ICanShare)
{
/***** Share (publish social note in timeline) *****/
SocPub.AuthorCod = SocNot.UsrCod;
SocPub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod;
SocPub.NotCod = SocNot.NotCod;
Soc_PublishSocialNoteInTimeline (&SocPub); // Set SocPub.PubCod
/* Update number of times this social note is shared */
Soc_UpdateNumTimesANoteHasBeenShared (&SocNot);
/* Update number of times this social note is shared */
Soc_UpdateNumTimesANoteHasBeenShared (&SocNot);
/***** Message of success *****/
Lay_ShowAlert (Lay_SUCCESS,Txt_SOCIAL_PUBLISHING_Shared);
/***** Message of success *****/
Lay_ShowAlert (Lay_SUCCESS,Txt_SOCIAL_PUBLISHING_Shared);
/***** Show the social note just shared *****/
Soc_WriteSocialNote (&SocPub,&SocNot,true,false);
/***** Show the social note just shared *****/
Soc_WriteSocialNote (&SocPub,&SocNot,true,false);
}
}
else
Lay_ShowAlert (Lay_WARNING,Txt_The_original_post_no_longer_exists);
}
/*****************************************************************************/

View File

@ -15318,27 +15318,6 @@ const char *Txt_It_is_mandatory_to_choose_a_group =
"Escolher um grupo é obrigatório";
#endif
const char *Txt_It_is_not_possible_to_publish_your_comment =
#if L==1
"No és possible publicar el comentari.";
#elif L==2
"Es ist nicht möglich, um Ihren Kommentar zu veröffentlichen.";
#elif L==3
"It is not possible to publish your comment.";
#elif L==4
"No es posible publicar el comentario.";
#elif L==5
"Il est impossible de publier votre commentaire.";
#elif L==6
"No es posible publicar el comentario."; // Okoteve traducción
#elif L==7
"Non è possibile pubblicare il commento.";
#elif L==8
"Nie jest możliwe, aby opublikować komentarz.";
#elif L==9
"Não é possível publicar o seu comentário.";
#endif
const char *Txt_It_is_optional_to_choose_a_group =
#if L==1
"Elegir grupo es voluntario"; // Necessita traduccio
@ -40813,10 +40792,10 @@ const char *Txt_The_ID_X_has_been_confirmed = // Warning: it is very important t
"Il ID <strong>%s</strong>"
" &egrave; stato confermato.";
#elif L==8
"The ID ID <strong>%s</strong>"
"The ID <strong>%s</strong>"
" has been confirmed."; // Potrzebujesz tlumaczenie
#elif L==9
"The ID ID <strong>%s</strong>"
"The ID <strong>%s</strong>"
" has been confirmed."; // Necessita de tradução
#endif
@ -40843,10 +40822,10 @@ const char *Txt_The_ID_X_has_been_registered_successfully = // Warning: it is ve
"Il ID <strong>%s</strong>"
" &egrave; stato registrato con successo.";
#elif L==8
"The ID ID <strong>%s</strong>"
"The ID <strong>%s</strong>"
" has been registered successfully."; // Potrzebujesz tlumaczenie
#elif L==9
"The ID ID <strong>%s</strong>"
"The ID <strong>%s</strong>"
" has been registered successfully."; // Necessita de tradução
#endif
@ -42305,6 +42284,26 @@ const char *Txt_The_numerical_code_X_already_exists = // Warning: it is very imp
"The ISO 3166-1 numerical code %03ld already exists."; // Necessita de tradução
#endif
const char *Txt_The_original_post_no_longer_exists =
#if L==1
"La publicaci&oacute; original ja no existeix.";
#elif L==2
"Der urspr&uuml;ngliche Post nicht mehr existiert.";
#elif L==3
"The original post no longer exists.";
#elif L==4
"La publicaci&oacute;n original ya no existe.";
#elif L==5
"La publication originale a disparu.";
#elif L==6
"La publicaci&oacute;n original ya no existe."; // Okoteve traducción
#elif L==7
"La pubblicazione originale non esiste pi&ugrave;.";
#elif L==8
"Oryginalna publikacja ju&zdot; nie istnieje.";
#elif L==9
"A publica&ccedil;&atilde;o original n&atilde;o existe mais.";
#endif
const char *Txt_The_password_can_not_consist_only_of_digits =
#if L==1