From 334a49cde2a5bc985f14bf85f6d09ff4fc7486c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Fri, 1 Jan 2016 20:19:43 +0100 Subject: [PATCH] Version 15.88 --- icon/share64x64.png | Bin 0 -> 1314 bytes icon/shared64x64.png | Bin 0 -> 1920 bytes sql/cambios.sql | 7 +- swad_ID.c | 2 +- swad_ID.h | 2 +- swad_QR.c | 2 +- swad_QR.h | 2 +- swad_RSS.c | 2 +- swad_RSS.h | 2 +- swad_account.c | 2 +- swad_account.h | 2 +- swad_action.c | 14 +- swad_action.h | 298 ++++++++++++++++++++++--------------------- swad_announcement.c | 2 +- swad_announcement.h | 2 +- swad_assignment.c | 2 +- swad_assignment.h | 2 +- swad_attendance.c | 2 +- swad_attendance.h | 2 +- swad_banner.c | 2 +- swad_banner.h | 2 +- swad_calendar.c | 2 +- swad_calendar.h | 2 +- swad_centre.c | 2 +- swad_centre.h | 2 +- swad_changelog.h | 9 +- swad_chat.c | 2 +- swad_chat.h | 2 +- swad_config.c | 2 +- swad_config.h | 2 +- swad_connected.c | 2 +- swad_connected.h | 2 +- swad_constant.h | 2 +- swad_country.c | 2 +- swad_country.h | 2 +- swad_course.c | 2 +- swad_course.h | 2 +- swad_cryptography.c | 2 +- swad_cryptography.h | 2 +- swad_database.c | 2 +- swad_database.h | 2 +- swad_date.c | 2 +- swad_date.h | 2 +- swad_degree.c | 2 +- swad_degree.h | 2 +- swad_department.c | 2 +- swad_department.h | 2 +- swad_enrollment.c | 2 +- swad_enrollment.h | 2 +- swad_exam.h | 2 +- swad_file.c | 2 +- swad_file.h | 2 +- swad_file_browser.c | 2 +- swad_file_browser.h | 2 +- swad_follow.c | 2 +- swad_follow.h | 2 +- swad_forum.c | 2 +- swad_forum.h | 2 +- swad_global.c | 2 +- swad_global.h | 2 +- swad_group.c | 2 +- swad_group.h | 2 +- swad_help.c | 2 +- swad_help.h | 2 +- swad_holiday.c | 2 +- swad_holiday.h | 2 +- swad_icon.c | 2 +- swad_icon.h | 2 +- swad_import.c | 2 +- swad_import.h | 2 +- swad_indicator.c | 2 +- swad_indicator.h | 2 +- swad_info.c | 2 +- swad_info.h | 2 +- swad_institution.c | 2 +- swad_institution.h | 2 +- swad_layout.c | 2 +- swad_layout.h | 2 +- swad_link.c | 2 +- swad_link.h | 2 +- swad_logo.c | 2 +- swad_logo.h | 2 +- swad_mail.c | 6 +- swad_mail.h | 2 +- swad_main.c | 2 +- swad_mark.c | 2 +- swad_mark.h | 2 +- swad_menu.c | 2 +- swad_menu.h | 2 +- swad_message.c | 2 +- swad_message.h | 2 +- swad_network.c | 2 +- swad_network.h | 2 +- swad_nickname.c | 2 +- swad_nickname.h | 2 +- swad_notice.c | 2 +- swad_notice.h | 2 +- swad_notification.c | 2 +- swad_notification.h | 2 +- swad_pagination.c | 2 +- swad_pagination.h | 2 +- swad_parameter.c | 2 +- swad_parameter.h | 2 +- swad_password.c | 2 +- swad_password.h | 2 +- swad_photo.c | 2 +- swad_photo.h | 2 +- swad_place.c | 2 +- swad_place.h | 2 +- swad_plugin.c | 2 +- swad_plugin.h | 2 +- swad_preference.c | 2 +- swad_preference.h | 2 +- swad_privacy.c | 2 +- swad_privacy.h | 2 +- swad_profile.c | 2 +- swad_profile.h | 2 +- swad_record.c | 2 +- swad_record.h | 2 +- swad_role.c | 2 +- swad_role.h | 2 +- swad_scope.c | 2 +- swad_scope.h | 2 +- swad_search.c | 7 +- swad_search.h | 2 +- swad_session.c | 2 +- swad_session.h | 2 +- swad_setup.c | 2 +- swad_setup.h | 2 +- swad_social.c | 289 ++++++++++++++++++++++++++++++++++------- swad_social.h | 5 +- swad_statistic.c | 2 +- swad_statistic.h | 2 +- swad_string.c | 2 +- swad_string.h | 2 +- swad_survey.c | 2 +- swad_survey.h | 2 +- swad_syllabus.c | 2 +- swad_syllabus.h | 2 +- swad_tab.c | 2 +- swad_tab.h | 2 +- swad_test.c | 9 +- swad_test.h | 2 +- swad_test_import.c | 2 +- swad_test_import.h | 2 +- swad_text.c | 65 +++++++++- swad_text.h | 2 +- swad_theme.c | 2 +- swad_theme.h | 2 +- swad_timetable.c | 2 +- swad_timetable.h | 2 +- swad_user.c | 6 +- swad_user.h | 2 +- swad_web_service.c | 2 +- swad_web_service.h | 2 +- swad_xml.c | 2 +- swad_xml.h | 2 +- swad_zip.c | 2 +- swad_zip.h | 2 +- 159 files changed, 650 insertions(+), 357 deletions(-) create mode 100644 icon/share64x64.png create mode 100644 icon/shared64x64.png diff --git a/icon/share64x64.png b/icon/share64x64.png new file mode 100644 index 0000000000000000000000000000000000000000..a7dd1ae2f12d7fb04d3a58eb466955dee2d591b2 GIT binary patch literal 1314 zcmV+-1>O3IP)eSad^g zZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00fRnL_t(&-tAajOdM4d{_e~U5Nz2^ z!H^VV!Nk}QG@7EOim<;^u>902(g$g@N+?8(#H2BOFcM>FYO1kO8|_b04G*NXYNd2p za2LCX)fZz7ltyK-K|=_%MQ~x+nR|U$whb^_?!b)kVb9CX-h1YrZ_YjUobz2EDM?9+ zDe~IQr&s@L)8z}lhpo;+XW;=`>|bd@ePX0>H+oPZM)Q;g_M&Qyjfpe(L^vviI#oM* z%>`gbFXT+xr0!?ZlBuZWo#?yYPHI6g48V4rM@g2@4ky$6PUc5V??frQ=6RsnHqp-H z#Pg&lqvoq?OGiaxj8~#a7~4x5Z>w~VGEs6VlZDLjKxuYlfMu?rG(qkUj4d7#i~+Fl`IGfmW>=B(OB`C<^T-QnfVl_)X zF<*F^jQkve12NYGT3E))~oHuopiD!T_*K3~!oiRG(KDdSr1L$Ayn{aYK(I z+JSW4$0>*pm^V|Js;6(#wQ<8~Qd!TAt}3D~3KHFlwQ7>;~r|HMc zx{8#;#|?jt@%*0(+M|zQ1H_vU86x5@){>5%&_L*58`u_Dbhfm5xM8e($lKI1mPc&> znG{DP?*$)Fg$TR=s@Bi!qdQr?E(nuCfq#s%DXqZQ@#_T#|fz6o9cO}K1BrFw)nCWLiW*8zy*d^$oEzQ}dW9eRvZgMH+z~=Z0?uPH}O=)rlL!_#>E0$pg4U4>vRnz%c9> z!AS7l?_fp#;$0?Zq-K8`U`HQML$Z3=gOdO}snT6aB_56D^Ke5GWQRs^PfAjf@;{b; Y0ixK6r`^S6wEzGB07*qoM6N<$g4t?OIRF3v literal 0 HcmV?d00001 diff --git a/icon/shared64x64.png b/icon/shared64x64.png new file mode 100644 index 0000000000000000000000000000000000000000..da88d7419f6d5b3444b718879ca75ef82e48eb00 GIT binary patch literal 1920 zcmV-`2Y>j9P)4+mJ#Yq9_U02y>e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00!tuL_t(|+U=TMY!ufO$A5Qb zcD>lx>j1GsNgIrl6fhq#HUubX($F}Kgd(L6r4LP8ui4nRUqUF9QmJaxhoYjkYSof} z?XeQ6QmsU7RaFTff~vZ8Xhh;7mtdz}Od^V1V*G)P+1=T>w+~)ZlU`R>a>M7BzTf6wT1$0Vfa(L! zA1t1JZh2r{()LBB62Cv7(Q8UJ?<~{DqC;h2HNI05T3t+8{^{2l!ZU6w`>=-bVyUsT zul?}*c6k6ornCF#nMi(;fTFxsEVNYk`LG)QtwL>)NZ-tBCDIFOlfvF<5y>l98$I3E z%C+(U40mRs2dobI>1rBfS%5_X+63Zpg>vZ58VY$r!S-_|gR6r@bTwVcz7SYnzod91 zHqa)OT{D;OYeGNnH}2kk>d?SYR)xTm4b`mK@__d5$ombpvKr@VN1>KUB?lkdxb>v9 zrcVuZs_gNAs$gm9i2a{4z`_(w4GP5SUQ-Rs>MfZjKv<4%bAdd-A|b@KgyE8D0$4s)*jP3;feqiwS}B%9gDY}d0T9(Ah1fH zmD0xwg!mTl6<|YJR}+kOUGvl+RrstKPECO6Z?7Ua zza?ysKMN$vuraTe*L1cy(l{f=7XjXMk{4(bhVVSo-4Z$GS_qT}@B!^Wb&}6>7MK8% zUEgEz=S#L z{Zr(f>K03yKmg*k zJT3p1T}@ZoXNK*ZLtx{M`?x4SDDuDspfHWZM}cnxe*{KmKKMhy1>StkzvOc4!Zsna zYD-2c6_BqLcH3BgkI3*JyyRWzHY1T_$UDjb>vohhj>=2FP6KH>o*RA|kJ(%A6Es$F z^x!*=6LoS4GXWl~GmhFSR^u}H_kiC4KM9$Pr9vR}6(gYlo@=(Ud@kNI2ppS?@jFM{ zaT0WyJRy_jRNdCqe!&GNnR6d;r^!1Kz^mn*cln;}whavFCYpG0^bXnymGU=usK*xM^otf z=QsBMBfqidp$Y`5Vd25v?;dCznL4+;&PR7k*gXMi8ms8J_D;Sbcmw!sn!T|HXaL?0 znM_O_T;EWl%b0dwL|tu+GVyg=**EMM8^SYYt5~xpjDw|mS<V<<+3ZK@b$KApAstu^m>VW z@iykCzi8+liM=U_Hh9KtaB|L=k^q%E7SY)}2*9TUc>!BQTa;3cSriC=a9oX!2{;7! zZ%bwu`f4^6F+_LHzqOMN~k@|OkT{5(-~%qRz_#LcE-l&r+_a2yMX0sX>^1L_O__z6ieY7F`dw!J$nE+-^%C| z`F;EL-Spb2f@j(wLRgxBh6iFz|$fEl5o z+_W7sXXls^!_nyli!R)o);XCCX54sOp?X}b2l}#308JPjZrRe&JF-rIyTm=OxMfQ! z+srBf9(nFTF3Jy1YC`*S>Tlm@*EFMJMZlLG%iwgZtjqtrrNY0L$T|I5B$?S@M*dXx zqfYDGU6o42caM@?79ya2^e@wX*_o$g7^dcV!=1D*tkk3?#2SSva71Pfv%!oLV7T*t z4?fhX+V83M{Y@$92eFb{)JOt>Kzq%n7wqb8iTvhfTWeXB0|2%L*72tK?&Lm1ohMHy z{a!SlHZUHZkmD=Co!MYkU{#>VX)lpO4msqILk>AO$A1CF`J$0BdhN~t0000Cod); fprintf (Gbl.F.Out,""); - /* Write form to remove this note */ - if (PutIconRemove && - Gbl.Usrs.Me.Logged && - UsrDat->UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // I am the author - Soc_PutFormToRemoveSocialPublishing (SocPub->PubCod); + /***** Put icons to share/unshare/remove *****/ + if (Gbl.Usrs.Me.Logged) + { + if (UsrDat->UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // I am the author + { + if (PutIconRemove) + /* Put icon to remove this publishing */ + Soc_PutFormToRemoveSocialPublishing (SocPub->PubCod); + } + else // I am not the author + { + if (Soc_CheckIfNoteIsYetPublishedByMe (SocNot->NotCod)) // I have yet published this social note + /* Put icon to unshare this publishing */ + Soc_PutFormToUnshareSocialPublishing (SocPub->PubCod); + else // I have not yet published this social note + /* Put icon to share this publishing */ + Soc_PutFormToShareSocialPublishing (SocPub->PubCod); + } + } } else { @@ -470,7 +508,6 @@ static void Soc_WriteNoteDate (time_t TimeUTC) fprintf (Gbl.F.Out,""); } - /*****************************************************************************/ /********* Put form to go to an action depending on the social note **********/ /*****************************************************************************/ @@ -608,7 +645,7 @@ void Soc_StoreAndPublishSocialNote (Soc_NoteType_t NoteType,long Cod) long CtrCod; long DegCod; long CrsCod; - long NotCod; // Note code stored in database + struct SocialPublishing SocPub; if (NoteType == Soc_NOTE_FORUM_POST) { @@ -642,14 +679,28 @@ void Soc_StoreAndPublishSocialNote (Soc_NoteType_t NoteType,long Cod) (unsigned) NoteType,Gbl.Usrs.Me.UsrDat.UsrCod, CtyCod,InsCod,CtrCod,DegCod,CrsCod, Cod); - NotCod = DB_QueryINSERTandReturnCode (Query,"can not create new social note"); + SocPub.NotCod = DB_QueryINSERTandReturnCode (Query,"can not create new social note"); - /***** Publish social note *****/ + /***** Publish social note in timeline *****/ + SocPub.AuthorCod = + SocPub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; + Soc_PublishSocialNoteInTimeline (&SocPub); + } + +/*****************************************************************************/ +/***************** Put contextual link to write a new post *******************/ +/*****************************************************************************/ + +static void Soc_PublishSocialNoteInTimeline (struct SocialPublishing *SocPub) + { + char Query[256]; + + /***** Publish social note in timeline *****/ sprintf (Query,"INSERT INTO social_timeline" " (AuthorCod,PublisherCod,NotCod,TimePublish)" " VALUES" " ('%ld','%ld','%ld',NOW())", - Gbl.Usrs.Me.UsrDat.UsrCod,Gbl.Usrs.Me.UsrDat.UsrCod,NotCod); + SocPub->AuthorCod,SocPub->PublisherCod,SocPub->NotCod); DB_QueryINSERT (Query,"can not publish social note"); } @@ -766,7 +817,53 @@ static void Soc_GetAndWriteSocialPost (long PstCod) } /*****************************************************************************/ -/*********************** Form to remove social note **************************/ +/********************* Form to share social publishing ***********************/ +/*****************************************************************************/ + +static void Soc_PutFormToShareSocialPublishing (long PubCod) + { + extern const char *Txt_Share; + + /***** Form to share social publishing *****/ + Act_FormStart (ActShaSocPub); + Soc_PutHiddenParamPubCod (PubCod); + fprintf (Gbl.F.Out,"
" + "" + "
", + Gbl.Prefs.IconsURL, + Txt_Share, + Txt_Share); + Act_FormEnd (); + } + +/*****************************************************************************/ +/************ Form to unshare (stop sharing) social publishing ***************/ +/*****************************************************************************/ + +static void Soc_PutFormToUnshareSocialPublishing (long PubCod) + { + extern const char *Txt_Shared; + + /***** Form to share social publishing *****/ + Act_FormStart (ActUnsSocPub); + Soc_PutHiddenParamPubCod (PubCod); + fprintf (Gbl.F.Out,"
" + "" + "
", + Gbl.Prefs.IconsURL, + Txt_Shared, + Txt_Shared); + Act_FormEnd (); + } + +/*****************************************************************************/ +/******************** Form to remove social publishing ***********************/ /*****************************************************************************/ static void Soc_PutFormToRemoveSocialPublishing (long PubCod) @@ -814,6 +911,86 @@ static long Soc_GetParamPubCod (void) return PubCod; } +/*****************************************************************************/ +/************************* Share a social publishing *************************/ +/*****************************************************************************/ + +void Soc_ShareSocialPublishing (void) + { + extern const char *Txt_Shared; + struct SocialPublishing SocPub; + bool ICanShare; + bool IHavePublishedThisNote; + + /***** Get the code of the social publishing to share *****/ + SocPub.PubCod = Soc_GetParamPubCod (); + + /***** Get data of social publishing *****/ + Soc_GetDataOfSocialPublishingByCod (&SocPub); + + ICanShare = (Gbl.Usrs.Me.Logged && + SocPub.AuthorCod != Gbl.Usrs.Me.UsrDat.UsrCod); // I am not the author + if (ICanShare) + { + /***** Check if I have yet shared this social note *****/ + IHavePublishedThisNote = Soc_CheckIfNoteIsYetPublishedByMe (SocPub.NotCod); + if (!IHavePublishedThisNote) + { + /***** Share (publish social note in timeline) *****/ + SocPub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; + Soc_PublishSocialNoteInTimeline (&SocPub); + + /***** Message of success *****/ + Lay_ShowAlert (Lay_SUCCESS,Txt_Shared); + } + } + + /***** Write timeline after removing *****/ + Soc_ShowFollowingTimeline (); + } + +/*****************************************************************************/ +/************** Unshare a previously shared social publishing ****************/ +/*****************************************************************************/ + +void Soc_UnshareSocialPublishing (void) + { + extern const char *Txt_Unshared; + struct SocialPublishing SocPub; + struct SocialNote SocNot; + bool ICanUnshare; + bool IHavePublishedThisNote; + + /***** Get the code of the social publishing to unshare *****/ + SocPub.PubCod = Soc_GetParamPubCod (); + + /***** Get data of social publishing *****/ + Soc_GetDataOfSocialPublishingByCod (&SocPub); + + /***** Get data of social note *****/ + SocNot.NotCod = SocPub.NotCod; + Soc_GetDataOfSocialNoteByCod (&SocNot); + + ICanUnshare = (Gbl.Usrs.Me.Logged && + SocPub.AuthorCod != Gbl.Usrs.Me.UsrDat.UsrCod); // I am not the author + if (ICanUnshare) + { + /***** Check if I have yet shared this social note *****/ + IHavePublishedThisNote = Soc_CheckIfNoteIsYetPublishedByMe (SocPub.NotCod); + if (IHavePublishedThisNote) + { + /***** Delete social publishing from database *****/ + Soc_DeleteASocialPublishingFromDB (&SocPub,&SocNot); + + /***** Message of success *****/ + Lay_ShowAlert (Lay_SUCCESS,Txt_Unshared); + } + } + + /***** Write timeline after unsharing *****/ + Soc_ShowFollowingTimeline (); + } + /*****************************************************************************/ /******************* Request the removal of a social note ********************/ /*****************************************************************************/ @@ -879,9 +1056,7 @@ void Soc_RemoveSocialPublishing (void) extern const char *Txt_Comment_removed; struct SocialPublishing SocPub; struct SocialNote SocNot; - unsigned long NumPubs; bool ICanRemove; - char Query[128]; /***** Get the code of the social publishing to remove *****/ SocPub.PubCod = Soc_GetParamPubCod (); @@ -898,30 +1073,8 @@ void Soc_RemoveSocialPublishing (void) SocNot.NoteType == Soc_NOTE_SOCIAL_POST); if (ICanRemove) { - /***** Remove social publishing *****/ - sprintf (Query,"DELETE FROM social_timeline WHERE PubCod='%ld'", - SocPub.PubCod); - DB_QueryDELETE (Query,"can not remove a social publishing"); - - /***** Count number of times this note - is published in timeline after removal *****/ - NumPubs = Soc_GetNumPubsOfANote (SocNot.NotCod); - - if (NumPubs == 0) // This was the last publishing of this note - { - /***** Remove social note *****/ - sprintf (Query,"DELETE FROM social_notes WHERE NotCod='%ld'", - SocNot.NotCod); - DB_QueryDELETE (Query,"can not remove a social note"); - - /***** Remove social post *****/ - if (SocNot.NoteType == Soc_NOTE_SOCIAL_POST) - { - sprintf (Query,"DELETE FROM social_posts WHERE PstCod='%ld'", - SocNot.Cod); - DB_QueryDELETE (Query,"can not remove a social post"); - } - } + /***** Delete social publishing from database *****/ + Soc_DeleteASocialPublishingFromDB (&SocPub,&SocNot); /***** Message of success *****/ Lay_ShowAlert (Lay_SUCCESS,Txt_Comment_removed); @@ -931,6 +1084,56 @@ void Soc_RemoveSocialPublishing (void) Soc_ShowFollowingTimeline (); } +/*****************************************************************************/ +/**************** Delete a social publishing from database *******************/ +/*****************************************************************************/ + +static void Soc_DeleteASocialPublishingFromDB (const struct SocialPublishing *SocPub, + const struct SocialNote *SocNot) + { + char Query[128]; + unsigned long NumPubs; + + /***** Remove social publishing *****/ + sprintf (Query,"DELETE FROM social_timeline WHERE PubCod='%ld'", + SocPub->PubCod); + DB_QueryDELETE (Query,"can not remove a social publishing"); + + /***** Count number of times this note + is published in timeline after removal *****/ + NumPubs = Soc_GetNumPubsOfANote (SocNot->NotCod); + + if (NumPubs == 0) // This was the last publishing of this note + { + /***** Remove social note *****/ + sprintf (Query,"DELETE FROM social_notes WHERE NotCod='%ld'", + SocNot->NotCod); + DB_QueryDELETE (Query,"can not remove a social note"); + + /***** Remove social post *****/ + if (SocNot->NoteType == Soc_NOTE_SOCIAL_POST) + { + sprintf (Query,"DELETE FROM social_posts WHERE PstCod='%ld'", + SocNot->Cod); + DB_QueryDELETE (Query,"can not remove a social post"); + } + } + } + +/*****************************************************************************/ +/***** Check if I have published a social note (I authored or shared it) *****/ +/*****************************************************************************/ + +static bool Soc_CheckIfNoteIsYetPublishedByMe (long NotCod) + { + char Query[128]; + + sprintf (Query,"SELECT COUNT(*) FROM social_timeline" + " WHERE NotCod='%ld' AND PublisherCod='%ld'", + NotCod,Gbl.Usrs.Me.UsrDat.UsrCod); + return (DB_QueryCOUNT (Query,"can not check if you have published a social note") != 0); + } + /*****************************************************************************/ /*********** Get number of publishings in timeline of a note code ************/ /*****************************************************************************/ diff --git a/swad_social.h b/swad_social.h index 7400d97d..9f93f319 100644 --- a/swad_social.h +++ b/swad_social.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -89,6 +89,9 @@ void Soc_StoreAndPublishSocialNote (Soc_NoteType_t NoteType,long Cod); void Soc_FormSocialPost (void); void Soc_ReceiveSocialPost (void); +void Soc_ShareSocialPublishing (void); +void Soc_UnshareSocialPublishing (void); + void Soc_RequestRemovalSocialNote (void); void Soc_RemoveSocialPublishing (void); diff --git a/swad_statistic.c b/swad_statistic.c index e4f7cba3..10424324 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_statistic.h b/swad_statistic.h index 12e88233..12a7de91 100644 --- a/swad_statistic.h +++ b/swad_statistic.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_string.c b/swad_string.c index ba1ef38b..69f2a61c 100644 --- a/swad_string.c +++ b/swad_string.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_string.h b/swad_string.h index 795b9ad0..5ef25891 100644 --- a/swad_string.h +++ b/swad_string.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_survey.c b/swad_survey.c index 2bcf975a..da364f7a 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_survey.h b/swad_survey.h index 0e65026b..84b411b6 100644 --- a/swad_survey.h +++ b/swad_survey.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_syllabus.c b/swad_syllabus.c index cc25d6cd..4520083c 100644 --- a/swad_syllabus.c +++ b/swad_syllabus.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_syllabus.h b/swad_syllabus.h index be716617..f9c65756 100644 --- a/swad_syllabus.h +++ b/swad_syllabus.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_tab.c b/swad_tab.c index 0f7fceab..79f4570a 100644 --- a/swad_tab.c +++ b/swad_tab.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_tab.h b/swad_tab.h index cdfbb147..3fd915bf 100644 --- a/swad_tab.h +++ b/swad_tab.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_test.c b/swad_test.c index 79d76b5d..171bc822 100644 --- a/swad_test.c +++ b/swad_test.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -1284,11 +1284,12 @@ void Tst_RenameTag (void) /* Step 2: If the new tag existed for a question ==> delete old tag from tst_question_tags; the new tag will remain If the new tag did not exist for a question ==> change old tag to new tag in tst_question_tags */ - sprintf (Query,"DROP TABLE IF EXISTS tst_question_tags_tmp"); + sprintf (Query,"DROP TEMPORARY TABLE IF EXISTS tst_question_tags_tmp"); if (mysql_query (&Gbl.mysql,Query)) DB_ExitOnMySQLError ("can not remove temporary table"); - sprintf (Query,"CREATE TEMPORARY TABLE tst_question_tags_tmp ENGINE=MEMORY SELECT QstCod FROM tst_question_tags WHERE TagCod='%ld'", + sprintf (Query,"CREATE TEMPORARY TABLE tst_question_tags_tmp ENGINE=MEMORY" + " SELECT QstCod FROM tst_question_tags WHERE TagCod='%ld'", ExistingNewTagCod); if (mysql_query (&Gbl.mysql,Query)) DB_ExitOnMySQLError ("can not create temporary table"); @@ -1309,7 +1310,7 @@ void Tst_RenameTag (void) OldTagCod); DB_QueryUPDATE (Query,"can not update a tag in some questions"); - sprintf (Query,"DROP TABLE IF EXISTS tst_question_tags_tmp"); + sprintf (Query,"DROP TEMPORARY TABLE IF EXISTS tst_question_tags_tmp"); if (mysql_query (&Gbl.mysql,Query)) DB_ExitOnMySQLError ("can not remove temporary table"); diff --git a/swad_test.h b/swad_test.h index bddcb4b1..8279e9ec 100644 --- a/swad_test.h +++ b/swad_test.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_test_import.c b/swad_test_import.c index 800389d9..33355f88 100644 --- a/swad_test_import.c +++ b/swad_test_import.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_test_import.h b/swad_test_import.h index 6f71b438..2a93a7d1 100644 --- a/swad_test_import.h +++ b/swad_test_import.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_text.c b/swad_text.c index f66a708d..9db1127e 100644 --- a/swad_text.c +++ b/swad_text.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas Català translation: Antonio Cañas Vargas @@ -34616,6 +34616,48 @@ const char *Txt_SEX_SINGULAR_Abc[Usr_NUM_SEXS] = #endif }; +const char *Txt_Share = +#if L==1 + "Compartir"; +#elif L==2 + "Teilen"; +#elif L==3 + "Share"; +#elif L==4 + "Compartir"; +#elif L==5 + "Partager"; +#elif L==6 + "Compartir"; // Okoteve traducción +#elif L==7 + "Condividere"; +#elif L==8 + "Dzielić"; +#elif L==9 + "Compartilhar"; +#endif + +const char *Txt_Shared = +#if L==1 + "Compartit"; +#elif L==2 + "Geteilt"; +#elif L==3 + "Shared"; +#elif L==4 + "Compartido"; +#elif L==5 + "Partagé"; +#elif L==6 + "Compartido"; // Okoteve traducción +#elif L==7 + "Condiviso"; +#elif L==8 + "Dzielone"; +#elif L==9 + "Compartilhado"; +#endif + const char *Txt_Shared_files_area = #if L==1 "Zona d'arxius compartits"; @@ -46744,6 +46786,27 @@ const char *Txt_Unread_BR_msgs = "Não
lidas"; #endif +const char *Txt_Unshared = // No longer shared +#if L==1 + "No compartit"; +#elif L==2 + "Kein geteilt"; +#elif L==3 + "Unshared"; +#elif L==4 + "No compartido"; +#elif L==5 + "Non partagé"; +#elif L==6 + "No compartido"; // Okoteve traducción +#elif L==7 + "Non condiviso"; +#elif L==8 + "Niedzieloną"; +#elif L==9 + "Não compartilhado"; +#endif + const char *Txt_Update = #if L==1 "Actualitzar"; diff --git a/swad_text.h b/swad_text.h index 858cfe43..2f90cba7 100644 --- a/swad_text.h +++ b/swad_text.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_theme.c b/swad_theme.c index 8b9fe45e..21b8a188 100644 --- a/swad_theme.c +++ b/swad_theme.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_theme.h b/swad_theme.h index 65374f3c..dc0a71be 100644 --- a/swad_theme.h +++ b/swad_theme.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_timetable.c b/swad_timetable.c index 1b1cfafc..572ce6d4 100644 --- a/swad_timetable.c +++ b/swad_timetable.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_timetable.h b/swad_timetable.h index 9a088c5c..2a2c6f51 100644 --- a/swad_timetable.h +++ b/swad_timetable.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_user.c b/swad_user.c index a492887e..a0a42592 100644 --- a/swad_user.c +++ b/swad_user.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as @@ -764,7 +764,7 @@ unsigned Usr_GetNumUsrsInCrssOfAUsr (long UsrCod,Rol_Role_t UsrRole, // The temporary table achieves speedup from ~2s to few ms /***** Remove temporary table if exists *****/ - sprintf (Query,"DROP TABLE IF EXISTS my_courses_tmp"); + sprintf (Query,"DROP TEMPORARY TABLE IF EXISTS my_courses_tmp"); if (mysql_query (&Gbl.mysql,Query)) DB_ExitOnMySQLError ("can not remove temporary tables"); @@ -787,7 +787,7 @@ unsigned Usr_GetNumUsrsInCrssOfAUsr (long UsrCod,Rol_Role_t UsrRole, NumUsrs = (unsigned) DB_QueryCOUNT (Query,"can not get the number of users"); /***** Remove temporary table *****/ - sprintf (Query,"DROP TABLE IF EXISTS my_courses_tmp"); + sprintf (Query,"DROP TEMPORARY TABLE IF EXISTS my_courses_tmp"); if (mysql_query (&Gbl.mysql,Query)) DB_ExitOnMySQLError ("can not remove temporary tables"); diff --git a/swad_user.h b/swad_user.h index ef39538b..225f0d5e 100644 --- a/swad_user.h +++ b/swad_user.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_web_service.c b/swad_web_service.c index 8e55e715..52477244 100644 --- a/swad_web_service.c +++ b/swad_web_service.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_web_service.h b/swad_web_service.h index ce13252c..bdca09d4 100644 --- a/swad_web_service.h +++ b/swad_web_service.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_xml.c b/swad_xml.c index fab07cac..cac30aed 100644 --- a/swad_xml.c +++ b/swad_xml.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_xml.h b/swad_xml.h index b6151806..de64aabb 100644 --- a/swad_xml.h +++ b/swad_xml.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_zip.c b/swad_zip.c index 97dbdda6..f8e8da13 100644 --- a/swad_zip.c +++ b/swad_zip.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as diff --git a/swad_zip.h b/swad_zip.h index 6b71c7a3..a7eff393 100644 --- a/swad_zip.h +++ b/swad_zip.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2015 Antonio Cañas Vargas + Copyright (C) 1999-2016 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as