Fix note in creation

This commit is contained in:
Laurent Destailleur 2020-07-06 16:52:28 +02:00
parent 61a7f54877
commit 3939a640e9

View File

@ -111,6 +111,7 @@ $parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
/*
* Actions
*/
@ -317,7 +318,7 @@ if (empty($reshook) && $action == 'add')
if (GETPOST("doneby") > 0) $object->userdoneid = GETPOST("doneby", "int");
}
$object->note_private = trim(GETPOST("note"));
$object->note_private = trim(GETPOST("note", "none"));
if (isset($_POST["contactid"])) $object->contact = $contact;
@ -465,7 +466,7 @@ if (empty($reshook) && $action == 'update')
$object->contactid = key($object->socpeopleassigned);
}
$object->fk_project = GETPOST("projectid", 'int');
$object->note_private = GETPOST("note", "none");
$object->note_private = trim(GETPOST("note", "none"));
$object->fk_element = GETPOST("fk_element", "int");
$object->elementtype = GETPOST("elementtype", "alphanohtml");
@ -1118,7 +1119,7 @@ if ($action == 'create')
// Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('note', (GETPOST('note', 'none') ?GETPOST('note', 'none') : $object->note_private), '', 180, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%');
$doleditor = new DolEditor('note', (GETPOST('note', 'none') ? GETPOST('note', 'none') : $object->note_private), '', 180, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%');
$doleditor->Create();
print '</td></tr>';