From 534a4ac014cd4961a407511cd5a499372490032a Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 25 May 2018 11:08:13 +0200 Subject: [PATCH] Fix better solution to fix textarea and wysiwyg since dolibarr 6.0 --- class/actions_subtotal.class.php | 65 +++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/class/actions_subtotal.class.php b/class/actions_subtotal.class.php index e2f2fed9..033c7f70 100644 --- a/class/actions_subtotal.class.php +++ b/class/actions_subtotal.class.php @@ -15,35 +15,56 @@ function createDictionaryFieldlist($parameters, &$object, &$action, $hookmanager { global $conf; - if ($parameters['tabname'] == MAIN_DB_PREFIX.'c_subtotal_free_text' && !empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) + if ($parameters['tabname'] == MAIN_DB_PREFIX.'c_subtotal_free_text') { - // Le CKEditor est forcé sur la page dictionnaire, pas possible de mettre une valeur custom - // petit js qui supprimer le wysiwyg et affiche le textarea si la conf (FCKEDITOR_ENABLE_DETAILS) n'est pas active + // Merci Dolibarr de remplacer les textarea par un input text + if ((float) DOL_VERSION >= 6.0) + { + $value = ''; + $sql = 'SELECT content FROM '.MAIN_DB_PREFIX.'c_subtotal_free_text WHERE rowid = '.GETPOST('rowid'); + $resql = $this->db->query($sql); + if ($resql && ($obj = $this->db->fetch_object($resql))) $value = $obj->content; + } + ?>