diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index c2dcd19eb9b..b8a53aadba6 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -15,6 +15,7 @@ * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2020 Nicolas ZABOURI * Copyright (C) 2022 Gauthier VERDOL + * Copyright (C) 2023 Lenin Rivas * * 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 @@ -1929,7 +1930,7 @@ if ($action == 'create') { print ''; print ''.$langs->trans('NotePublic').''; print ''; - $note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : null)); + $note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : (!empty($conf->global->PROPALE_ADDON_NOTE_PUBLIC_DEFAULT) ? $conf->global->PROPALE_ADDON_NOTE_PUBLIC_DEFAULT : null)), 'restricthtml'); $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a23c0611589..93a3e1b5536 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -16,6 +16,7 @@ * Copyright (C) 2018 Josep Lluís Amador * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2021 Grégory Blémand + * Copyright (C) 2023 Lenin Rivas * * 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 @@ -5740,15 +5741,16 @@ abstract class CommonObject * * @param string $fieldname Name of field * @param string $alternatevalue Alternate value to use + * @param string $type Type of data * @return string|string[] Default value (can be an array if the GETPOST return an array) **/ - public function getDefaultCreateValueFor($fieldname, $alternatevalue = null) + public function getDefaultCreateValueFor($fieldname, $alternatevalue = null, $type = 'alphanohtml') { global $conf, $_POST; // If param here has been posted, we use this value first. if (GETPOSTISSET($fieldname)) { - return GETPOST($fieldname, 'alphanohtml', 3); + return GETPOST($fieldname, $type, 3); } if (isset($alternatevalue)) {