From 042c6cc56e566b6a4e661b286b18bfa8164c8ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Feb 2019 08:50:35 +0100 Subject: [PATCH] Update html.formfile.class.php --- htdocs/core/class/html.formfile.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 6e7914d9206..6d0dcb657cd 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -7,7 +7,8 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2015 Bahfir Abbes * Copyright (C) 2016-2017 Ferran Marcet - + * Copyright (C) 2019 Frédéric France + * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -66,11 +67,12 @@ class FormFile * @param int $addcancel 1=Add 'Cancel' button * @param int $sectionid If upload must be done inside a particular ECM section (is sectionid defined, sectiondir must not be) * @param int $perm Value of permission to allow upload - * @param int $size Length of input file area. Deprecated. + * @param int $size Length of input file area. Deprecated. * @param Object $object Object to use (when attachment is done on an element) * @param string $options Add an option column - * @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). @deprecated 2 should never be used and if 1 is used, option should no be enabled. - * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' + * @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). + * Deprecated 2 should never be used and if 1 is used, option should no be enabled. + * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' * @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files * @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM) * @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*') @@ -83,6 +85,10 @@ class FormFile global $conf,$langs, $hookmanager; $hookmanager->initHooks(array('formfile')); + // Deprecation warning + if ($useajax == 2) { + dol_syslog(__METHOD__ . ": using 2 for useajax is deprecated and should be not used", LOG_WARNING); + } if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0;