diff --git a/swad_changelog.h b/swad_changelog.h index 47d1ece0b..1245dd583 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -120,26 +120,31 @@ // TODO: Move info about number of files to bottom of file browsers // TODO: To avoid wrong email addresses, when a user fills his/her email address, check if the domain is in the white list of allowed domains. If not, ask for confirmation. // TODO: Filtering email addresses --> an email address can not finish in "." -// TODO: Upload an image in social posts, in test questions, in forum posts, in private messages, etc. // TODO: Change PhotoAttribution in table centres from TEXT to VARCHAR(255) (check maximum length first) // TODO: In social refreshing via AJAX, an error occurs when session expirates // TODO: Messages in msg_content_deleted older than a certain time should be deleted to ensure the protection of personal data // TODO: Request confirmation to remove user's photo // TODO: FIX BUG: In Statistics > Indicators, if we select only 5 indicators, the message "The list is too big..." is shown. // TODO: FIX BUG: A teacher uploads a document in course documents zone, then he/she unregister from course, the he/she search for his/her documents, a document is shown in results but he/she can not view it -// TODO: FIX BUG: Txt_Save_file_properties does not have sense in briefcase, because nothing to save (license should be editable in briefcase?) /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.218.3 (2016-06-04)" +#define Log_PLATFORM_VERSION "SWAD 15.218.5 (2016-06-04)" #define CSS_FILE "swad15.218.css" #define JS_FILE "swad15.216.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.218.5: Jun 04, 2016 Fix bug in social notes, reported by Raymon Moreno Colina. (? lines) + 2 changes necessary in database: +DROP INDEX NoteType ON social_notes; +CREATE INDEX NoteType ON social_notes (NoteType,Cod); + + Version 15.218.4: Jun 04, 2016 User can change license of files in briefcase. + Code refactoring related to file metadata. (201936 lines) Version 15.218.3: Jun 04, 2016 Code refactoring related to setlocale. (201952 lines) Version 15.218.2: Jun 04, 2016 Checked value returned by setlocale in all calls. (201957 lines) Version 15.218.1: Jun 04, 2016 Change in listing of courses. (201934 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index 4b022fbc5..e50226c16 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -9236,7 +9236,6 @@ void Brw_ShowFileMetadata (void) bool ICanView = false; bool ICanEdit; bool ICanChangePublic = false; - bool ICanChangeLicense = false; bool FileHasPublisher; bool ShowPhoto; char PhotoURL[PATH_MAX+1]; @@ -9326,6 +9325,8 @@ void Brw_ShowFileMetadata (void) if (ICanEdit) // I can edit file properties { Act_FormStart (Brw_ActRecDatFile[Gbl.FileBrowser.Type]); + + /* Can the file be public? */ switch (Gbl.FileBrowser.Type) { case Brw_ADMI_DOCUM_INS: @@ -9336,40 +9337,27 @@ void Brw_ShowFileMetadata (void) case Brw_ADMI_SHARE_DEG: case Brw_ADMI_DOCUM_CRS: case Brw_ADMI_SHARE_CRS: - ICanChangePublic = true; - ICanChangeLicense = true; + ICanChangePublic = true; break; - case Brw_ADMI_TEACH_CRS: - ICanChangePublic = false; // A file in teachers' zones can not be public... - ICanChangeLicense = true; // ...but I can change its license + default: + ICanChangePublic = false; break; + } + + /* Put extra parameters */ + switch (Gbl.FileBrowser.Type) + { case Brw_ADMI_DOCUM_GRP: case Brw_ADMI_TEACH_GRP: case Brw_ADMI_SHARE_GRP: Grp_PutParamGrpCod (Gbl.CurrentCrs.Grps.GrpCod); - ICanChangePublic = false; // A file in group zones can not be public... - ICanChangeLicense = true; // ...but I can change its license - break; - case Brw_ADMI_ASSIG_USR: - case Brw_ADMI_WORKS_USR: - ICanChangePublic = false; // A file in assignments or works zones can not be public... - ICanChangeLicense = true; // ...but I can change its license break; case Brw_ADMI_ASSIG_CRS: case Brw_ADMI_WORKS_CRS: Usr_PutHiddenParUsrCodAll (Brw_ActRecDatFile[Gbl.FileBrowser.Type],Gbl.Usrs.Select.All); Usr_PutParamOtherUsrCodEncrypted (); - ICanChangePublic = false; // A file in assignments or works zones can not be public... - ICanChangeLicense = true; // ...but I can change its license - break; - case Brw_ADMI_MARKS_GRP: - Grp_PutParamGrpCod (Gbl.CurrentCrs.Grps.GrpCod); - ICanChangePublic = false; - ICanChangeLicense = false; break; default: - ICanChangePublic = false; - ICanChangeLicense = false; break; } Brw_ParamListFiles (FileMetadata.FileType, @@ -9492,7 +9480,7 @@ void Brw_ShowFileMetadata (void) "" "", The_ClassForm[Gbl.Prefs.Theme],Txt_License); - if (ICanChangeLicense) // I can edit file properties + if (ICanEdit) // I can edit file properties { fprintf (Gbl.F.Out,"