From 32ef42d163277ac67bc712900290335e9807f3fd Mon Sep 17 00:00:00 2001 From: Alain Rihs Date: Thu, 16 Dec 2021 10:22:43 +0100 Subject: [PATCH] Update notes.tpl.php See https://github.com/Dolibarr/dolibarr/issues/19580 The options of the advanced editor were not taken into account when editing public and private notes. I propose this code to fix this bug. --- htdocs/core/tpl/notes.tpl.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 6c01c44bc36..e0f0c5d9142 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -99,16 +99,26 @@ if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_ } else { $typeofdata = 'textarea:12:95%'; } +if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC)) { + $typeofdatapub = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. +} else { + $typeofdatapub = 'textarea:12:95%'; +} +if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE)) { + $typeofdatapriv = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. +} else { + $typeofdatapriv = 'textarea:12:95%'; +} print ''."\n"; print '
'."\n"; print '
'."\n"; $editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_public); print '
'."\n"; -print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); +print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdatapub, $moreparam, '', 0); print '
'."\n"; print '
'."\n"; -print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1)."\n"; +print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdatapub, '', null, null, $moreparam, 1)."\n"; print '
'."\n"; print '
'."\n"; if (empty($user->socid)) { @@ -116,10 +126,10 @@ if (empty($user->socid)) { print '
'."\n"; $editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_private); print '
'."\n"; - print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); + print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdatapriv, $moreparam, '', 0); print '
'."\n"; print '
'."\n"; - print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); + print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdatapriv, '', null, null, $moreparam, 1); print '
'."\n"; print '
'."\n"; }