From 15b1507c84e899a79c300426ee67017450fa6233 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 20 Oct 2013 20:58:38 +0200 Subject: [PATCH] Update html.formfile.class.php Add subfolders feature in GED managment --- htdocs/core/class/html.formfile.class.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 9f0f9089e76..9dac82d5a06 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -2,6 +2,7 @@ /* Copyright (c) 2008-2013 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (c) 2010 Juanjo Menent + * Copyright (c) 2013 Charles-Fr BENKE * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -717,8 +718,16 @@ class FormFile print ''; + //print '&file='.urlencode($relativepath.$file['name']).'">'; + if ($file['level1name'] <> $object->id) + $filepath=urlencode($object->id.'/'.$file['level1name'].'/'.$file['name']); + else + $filepath=urlencode($object->id.'/'.$file['name']); + print '&file='.$filepath.'">'; + print img_mime($file['name'],$file['name'].' ('.dol_print_size($file['size'],0,0).')').' '; + if ($file['level1name'] <> $object->id) + print $file['level1name'].'/'; print dol_trunc($file['name'],$maxlength,'middle'); print ''; print "\n"; @@ -738,7 +747,14 @@ class FormFile // ($param must start with &) print ''; if ($useinecm) print ''.img_view().'   '; - if ($permtodelete) print ''.img_delete().''; + if ($permtodelete) + { + if ($file['level1name'] <> $object->id) + $filepath=urlencode($file['level1name'].'/'.$file['name']); + else + $filepath=urlencode($file['name']); + print ''.img_delete().''; + } else print ' '; print ""; print "\n";