From 59a33db53dfac48125ddebc5a27376391db97261 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Oct 2012 20:10:29 +0200 Subject: [PATCH] Fix: Add warning to ask refresh. --- htdocs/core/ajax/ajaxdirpreview.php | 8 +++++++- htdocs/core/lib/files.lib.php | 1 + htdocs/langs/en_US/ecm.lang | 4 +++- htdocs/langs/fr_FR/ecm.lang | 3 ++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 1460d87bfba..9360d5b61ec 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -247,11 +247,17 @@ if ($type == 'directory') { $relativepath=$ecmdir->getRelativePath(); $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; + $filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','\.meta$','^temp$','^CVS$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); if ($section) $param.='§ion='.$section; $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection"))); - + // If $section defined with value 0 + if ($section == '0') + { + $filearray=array(); + $textifempty='
'.$langs->trans("DirNotSynchronizedSyncFirst").'

'; + } $formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,$maxlengthname,'',$url); } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 90a2f8970c8..d263748c2af 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -56,6 +56,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil global $object; dol_syslog("files.lib.php::dol_dir_list path=".$path." types=".$types." recursive=".$recursive." filter=".$filter." excludefilter=".json_encode($excludefilter)); + //print 'xxx'."files.lib.php::dol_dir_list path=".$path." types=".$types." recursive=".$recursive." filter=".$filter." excludefilter=".json_encode($excludefilter); $loaddate=($mode==1||$mode==2)?true:false; $loadsize=($mode==1||$mode==3)?true:false; diff --git a/htdocs/langs/en_US/ecm.lang b/htdocs/langs/en_US/ecm.lang index 8e754b080b0..c5417c33958 100644 --- a/htdocs/langs/en_US/ecm.lang +++ b/htdocs/langs/en_US/ecm.lang @@ -50,4 +50,6 @@ ConfirmDeleteSection=Can you confirm you want to delete the directory %s ECMDirectoryForFiles=Relative directory for files CannotRemoveDirectoryContainsFiles=Removed not possible because it contains some files ECMFileManager=File manager -ECMSelectASection=Select a directory on left tree... \ No newline at end of file +ECMSelectASection=Select a directory on left tree... +DirNotSynchronizedSyncFirst=This directory seems to be created or modified outside ECM module. You must click on "Refresh" button first to synchronize disk and database to get content of this directory. + \ No newline at end of file diff --git a/htdocs/langs/fr_FR/ecm.lang b/htdocs/langs/fr_FR/ecm.lang index ffbbf6ee79d..39adce0e0ed 100644 --- a/htdocs/langs/fr_FR/ecm.lang +++ b/htdocs/langs/fr_FR/ecm.lang @@ -50,4 +50,5 @@ ConfirmDeleteSection=Confirmez-vous la suppression du répertoire %s ? ECMDirectoryForFiles=Répertoire relatif pour les fichiers CannotRemoveDirectoryContainsFiles=Suppression impossible car des fichiers sont présents ECMFileManager=Gestionnaire fichier -ECMSelectASection=Sélectionner un répertoire sur l'arbre de gauche... \ No newline at end of file +ECMSelectASection=Sélectionner un répertoire sur l'arbre de gauche... +DirNotSynchronizedSyncFirst=Ce répertoire a été crée ou modifié en dehors du module GED. Cliquer sur le bouton "Rafraichir" afin de resyncronizer les informations sur disque et la base pour voir le contenu de ce répertoire.