From 6fb860e6ab97c1ff9100c3b4051de85c9239ef81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 21 Jan 2015 09:56:40 +0100 Subject: [PATCH] Version 14.63.1 --- swad_centre.c | 3 +++ swad_changelog.h | 3 ++- swad_degree.c | 3 +++ swad_file_browser.c | 14 ++++++++++++++ swad_file_browser.h | 1 + swad_institution.c | 3 +++ 6 files changed, 26 insertions(+), 1 deletion(-) diff --git a/swad_centre.c b/swad_centre.c index 6677b2f9e..846014c43 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -1429,6 +1429,9 @@ void Ctr_RemoveCentre (void) Ctr.CtrCod); DB_QueryDELETE (Query,"can not remove clipboards in a centre"); + /* Remove last accesses to file browsers related with this centre */ + Brw_RemoveFileBrowserLast (Brw_FILE_BRW_ADMIN_DOCUMENTS_CTR,Ctr.CtrCod); + /* Remove files in the centre from database */ Brw_RemoveFilesFromDB (-1L,Ctr.CtrCod,-1L,-1L,-1L,-1L); diff --git a/swad_changelog.h b/swad_changelog.h index b6d1bf375..02543c1ca 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -39,11 +39,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.63 (2015/01/21)" +#define Log_PLATFORM_VERSION "SWAD 14.63.1 (2015/01/21)" // 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 | tail -1 /* + Version 14.63.1: Jan 21, 2015 Remove last accesses to file browsers related with an institution, a centre or a degree. (175531 lines) Version 14.63: Jan 21, 2015 See/admin documents of degree, centre and institution. (175512 lines) 1 change necessary in database: CREATE TABLE IF NOT EXISTS file_browser_last (UsrCod INT NOT NULL,FileBrowser TINYINT NOT NULL,Cod INT NOT NULL DEFAULT -1,LastClick DATETIME NOT NULL,UNIQUE INDEX(UsrCod,FileBrowser,Cod)); diff --git a/swad_degree.c b/swad_degree.c index e366f1cd2..5ee5c09ab 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -3188,6 +3188,9 @@ static void Deg_RemoveDegreeCompletely (long DegCod) DegCod); DB_QueryDELETE (Query,"can not remove clipboards in a degree"); + /* Remove last accesses to file browsers related with this degree */ + Brw_RemoveFileBrowserLast (Brw_FILE_BRW_ADMIN_DOCUMENTS_DEG,DegCod); + /* Remove files in the degree from database */ Brw_RemoveFilesFromDB (-1L,-1L,DegCod,-1L,-1L,-1L); diff --git a/swad_file_browser.c b/swad_file_browser.c index 1419613d6..8b2fb679e 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -3878,6 +3878,20 @@ static void Brw_GetAndUpdateDateLastAccFileBrowser (const char *FieldNameDB) DB_QueryUPDATE (Query2,"can not update date of last access to a file browser"); } +/*****************************************************************************/ +/******************** Remove last accesses to file browser *******************/ +/*****************************************************************************/ + +void Brw_RemoveFileBrowserLast (Brw_FileBrowser_t FileBrowser,long Cod) + { + char Query[128]; + + sprintf (Query,"DELETE FROM file_browser_last" + " WHERE FileBrowser='%u' AND Cod='%ld'", + (unsigned) Brw_FileBrowserForDB[FileBrowser],Cod); + DB_QueryDELETE (Query,"can not remove last accesses to file browsers"); + } + /*****************************************************************************/ /************* Get the group of my last access to a common zone **************/ /*****************************************************************************/ diff --git a/swad_file_browser.h b/swad_file_browser.h index 30b7f8038..6c80141c6 100644 --- a/swad_file_browser.h +++ b/swad_file_browser.h @@ -149,6 +149,7 @@ void Brw_ShowAgainFileBrowserOrWorks (void); void Brw_RemoveSizeOfFileTreeFromDB (long CrsCod,long GrpCod,long UsrCod); void Brw_RemoveFilesFromDB (long InsCod,long CtrCod,long DegCod,long CrsCod,long GrpCod,long UsrCod); void Brw_CreateDirDownloadTmp (void); +void Brw_RemoveFileBrowserLast (Brw_FileBrowser_t FileBrowser,long Cod); void Brw_AskEditWorksCrs (void); void Brw_AskRemFileFromTree (void); void Brw_RemFileFromTree (void); diff --git a/swad_institution.c b/swad_institution.c index da67e389c..557cee45f 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -1384,6 +1384,9 @@ void Ins_RemoveInstitution (void) Ins.InsCod); DB_QueryDELETE (Query,"can not remove clipboards in an institution"); + /* Remove last accesses to file browsers related with this institution */ + Brw_RemoveFileBrowserLast (Brw_FILE_BRW_ADMIN_DOCUMENTS_INS,Ins.InsCod); + /* Remove files in the institution from database */ Brw_RemoveFilesFromDB (Ins.InsCod,-1L,-1L,-1L,-1L,-1L);