Use note_private instead of note

This commit is contained in:
Laurent Destailleur 2020-09-17 16:13:57 +02:00
parent d73642559c
commit d04d1d1499
3 changed files with 17 additions and 15 deletions

View File

@ -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 '<tr><td>';
print $langs->trans('CronNote')."</td><td>";
$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 "</td>";
print "<td>";
@ -581,7 +581,9 @@ if (($action == "create") || ($action == "edit"))
print '<tr><td>';
print $langs->trans('CronNote')."</td><td>";
print $langs->trans($object->note);
if (!is_null($object->note_private) && $object->note_private != '') {
print $langs->trans($object->note_private);
}
print "</td></tr>";
if (!empty($conf->multicompany->enabled))

View File

@ -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 = '';

View File

@ -1153,7 +1153,7 @@ if ($action == 'create' || $action == 'adduserldap')
print $langs->trans("Note");
print '</td><td>';
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 "</td></tr>\n";
@ -1161,7 +1161,7 @@ if ($action == 'create' || $action == 'adduserldap')
print '<tr><td class="tdtop">'.$langs->trans("Signature").'</td>';
print '<td>';
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 '</td></tr>';