From d04d1d1499e4d2226721bf36bf1f867f6a3cc475 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Sep 2020 16:13:57 +0200 Subject: [PATCH] Use note_private instead of note --- htdocs/cron/card.php | 10 ++++++---- htdocs/cron/class/cronjob.class.php | 18 +++++++++--------- htdocs/user/card.php | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index a39d4ba48b5..de4b8a03daa 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -136,7 +136,7 @@ if ($action == 'add') $object->params = GETPOST('params'); $object->md5params = GETPOST('md5params'); $object->module_name = GETPOST('module_name', 'alpha'); - $object->note = GETPOST('note', 'none'); + $object->note_private = GETPOST('note', 'restricthtml'); $object->datestart = dol_mktime(GETPOST('datestarthour', 'int'), GETPOST('datestartmin', 'int'), 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int')); $object->dateend = dol_mktime(GETPOST('dateendhour', 'int'), GETPOST('dateendmin', 'int'), 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int')); $object->datenextrun = dol_mktime(GETPOST('datenextrunhour', 'int'), GETPOST('datenextrunmin', 'int'), 0, GETPOST('datenextrunmonth', 'int'), GETPOST('datenextrunday', 'int'), GETPOST('datenextrunyear', 'int')); @@ -171,7 +171,7 @@ if ($action == 'update') $object->params = GETPOST('params'); $object->md5params = GETPOST('md5params'); $object->module_name = GETPOST('module_name', 'alpha'); - $object->note = GETPOST('note', 'none'); + $object->note_private = GETPOST('note', 'restricthtml'); $object->datestart = dol_mktime(GETPOST('datestarthour', 'int'), GETPOST('datestartmin', 'int'), 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int')); $object->dateend = dol_mktime(GETPOST('dateendhour', 'int'), GETPOST('dateendmin', 'int'), 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int')); $object->datenextrun = dol_mktime(GETPOST('datenextrunhour', 'int'), GETPOST('datenextrunmin', 'int'), 0, GETPOST('datenextrunmonth', 'int'), GETPOST('datenextrunday', 'int'), GETPOST('datenextrunyear', 'int')); @@ -382,7 +382,7 @@ if (($action == "create") || ($action == "edit")) print ''; print $langs->trans('CronNote').""; - $doleditor = new DolEditor('note', $object->note, '', 160, 'dolibarr_notes', 'In', true, false, 0, ROWS_4, '90%'); + $doleditor = new DolEditor('note', $object->note_private, '', 160, 'dolibarr_notes', 'In', true, false, 0, ROWS_4, '90%'); $doleditor->Create(); print ""; print ""; @@ -581,7 +581,9 @@ if (($action == "create") || ($action == "edit")) print ''; print $langs->trans('CronNote').""; - print $langs->trans($object->note); + if (!is_null($object->note_private) && $object->note_private != '') { + print $langs->trans($object->note_private); + } print ""; if (!empty($conf->multicompany->enabled)) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index fc038bb78bf..e1c9861cc9e 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -151,7 +151,7 @@ class Cronjob extends CommonObject if (isset($this->unitfrequency)) $this->unitfrequency = trim($this->unitfrequency); if (isset($this->frequency)) $this->frequency = trim($this->frequency); if (isset($this->status)) $this->status = trim($this->status); - if (isset($this->note)) $this->note = trim($this->note); + if (isset($this->note_private)) $this->note_private = trim($this->note_private); if (isset($this->nbrun)) $this->nbrun = trim($this->nbrun); if (isset($this->libname)) $this->libname = trim($this->libname); if (isset($this->test)) $this->test = trim($this->test); @@ -251,7 +251,7 @@ class Cronjob extends CommonObject $sql .= " ".(!isset($this->status) ? '0' : $this->status).","; $sql .= " ".$user->id.","; $sql .= " ".$user->id.","; - $sql .= " ".(!isset($this->note) ? 'NULL' : "'".$this->db->escape($this->note)."'").","; + $sql .= " ".(!isset($this->note_private) ? 'NULL' : "'".$this->db->escape($this->note_private)."'").","; $sql .= " ".(!isset($this->nbrun) ? '0' : $this->db->escape($this->nbrun)).","; $sql .= " ".(empty($this->maxrun) ? '0' : $this->db->escape($this->maxrun)).","; $sql .= " ".(!isset($this->libname) ? 'NULL' : "'".$this->db->escape($this->libname)."'").","; @@ -322,7 +322,7 @@ class Cronjob extends CommonObject $sql .= " t.processing,"; $sql .= " t.fk_user_author,"; $sql .= " t.fk_user_mod,"; - $sql .= " t.note,"; + $sql .= " t.note as note_private,"; $sql .= " t.nbrun,"; $sql .= " t.maxrun,"; $sql .= " t.libname,"; @@ -366,7 +366,7 @@ class Cronjob extends CommonObject $this->processing = $obj->processing; $this->fk_user_author = $obj->fk_user_author; $this->fk_user_mod = $obj->fk_user_mod; - $this->note = $obj->note; + $this->note_private = $obj->note_private; $this->nbrun = $obj->nbrun; $this->maxrun = $obj->maxrun; $this->libname = $obj->libname; @@ -429,7 +429,7 @@ class Cronjob extends CommonObject $sql .= " t.processing,"; $sql .= " t.fk_user_author,"; $sql .= " t.fk_user_mod,"; - $sql .= " t.note,"; + $sql .= " t.note as note_private,"; $sql .= " t.nbrun,"; $sql .= " t.libname,"; $sql .= " t.test"; @@ -501,7 +501,7 @@ class Cronjob extends CommonObject $line->processing = $obj->processing; $line->fk_user_author = $obj->fk_user_author; $line->fk_user_mod = $obj->fk_user_mod; - $line->note = $obj->note; + $line->note_private = $obj->note_private; $line->nbrun = $obj->nbrun; $line->libname = $obj->libname; $line->test = $obj->test; @@ -551,7 +551,7 @@ class Cronjob extends CommonObject if (isset($this->unitfrequency)) $this->unitfrequency = trim($this->unitfrequency); if (isset($this->frequency)) $this->frequency = trim($this->frequency); if (isset($this->status)) $this->status = trim($this->status); - if (isset($this->note)) $this->note = trim($this->note); + if (isset($this->note_private)) $this->note_private = trim($this->note_private); if (isset($this->nbrun)) $this->nbrun = trim($this->nbrun); if (isset($this->libname)) $this->libname = trim($this->libname); if (isset($this->test)) $this->test = trim($this->test); @@ -625,7 +625,7 @@ class Cronjob extends CommonObject $sql .= " status=".(isset($this->status) ? $this->status : "null").","; $sql .= " processing=".((isset($this->processing) && $this->processing > 0) ? $this->processing : "0").","; $sql .= " fk_user_mod=".$user->id.","; - $sql .= " note=".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : "null").","; + $sql .= " note=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; $sql .= " nbrun=".((isset($this->nbrun) && $this->nbrun > 0) ? $this->nbrun : "null").","; $sql .= " maxrun=".((isset($this->maxrun) && $this->maxrun > 0) ? $this->maxrun : "0").","; $sql .= " libname=".(isset($this->libname) ? "'".$this->db->escape($this->libname)."'" : "null").","; @@ -785,7 +785,7 @@ class Cronjob extends CommonObject $this->processing = 0; $this->fk_user_author = 0; $this->fk_user_mod = 0; - $this->note = ''; + $this->note_private = ''; $this->nbrun = ''; $this->maxrun = 100; $this->libname = ''; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 39bc9ee2fc2..209d70d5213 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1153,7 +1153,7 @@ if ($action == 'create' || $action == 'adduserldap') print $langs->trans("Note"); print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', GETPOSTISSET('note') ?GETPOST('note', 'none') : '', '', 120, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%'); + $doleditor = new DolEditor('note', GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : '', '', 120, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%'); $doleditor->Create(); print "\n"; @@ -1161,7 +1161,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''.$langs->trans("Signature").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('signature', GETPOST('signature'), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%'); + $doleditor = new DolEditor('signature', GETPOST('signature', 'restricthtml'), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%'); print $doleditor->Create(1); print '';