From 325d47c882d4a321b8c1ec8c019fca57b1e4ccd8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Oct 2012 13:18:52 +0200 Subject: [PATCH] Fix: Creation of notes was not using DolEditor class. --- htdocs/contrat/fiche.php | 13 ++++++++++++- htdocs/contrat/note.php | 6 +++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 73416c32d70..40bf8d84396 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -626,16 +626,27 @@ if ($action == 'create') } print ''.$langs->trans("NotePublic").''; + + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor('note_public', GETPOST('note_public'), '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); + print $doleditor->Create(1); + /* print ''; + */ if (! $user->societe_id) { print ''.$langs->trans("NotePrivate").''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor('note', GETPOST('note'), '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); + print $doleditor->Create(1); + /* print ''; + print '';*/ + print ''; } // Other attributes diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 21f1f41c4e4..481484f43c1 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -50,13 +50,13 @@ $object->fetch($id,$ref); if ($action == 'setnote_public' && $user->rights->contrat->creer) { - $result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES)); + $result=$object->update_note_public(dol_html_entity_decode(dol_htmlcleanlastbr(GETPOST('note_public')), ENT_QUOTES)); if ($result < 0) dol_print_error($db,$object->error); } else if ($action == 'setnote' && $user->rights->contrat->creer) { - $result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES)); + $result=$object->update_note(dol_html_entity_decode(dol_htmlcleanlastbr(GETPOST('note')), ENT_QUOTES)); if ($result < 0) dol_print_error($db,$object->error); } @@ -104,7 +104,7 @@ if ($id > 0 || ! empty($ref)) else print $langs->trans("CompanyHasNoAbsoluteDiscount"); print '.'; print ''; - + print ""; print '
';