21if (empty($object) || !is_object($object)) {
 
   22  print 
"Error, template page can't be called as URL";
 
   28$module       = $object->element;
 
   29$note_public  = 
'note_public';
 
   30$note_private = 
'note_private';
 
   32if ($module == 
"product") {
 
   35$colwidth = (isset($colwidth) ? $colwidth : (empty($cssclass) ? 
'25' : 
''));
 
   37$permission = (isset($permissionnote) ? $permissionnote : (isset($permission) ? $permission : (isset($user->rights->$module->create) ? $user->rights->$module->create : (isset($user->rights->$module->creer) ? $user->rights->$module->creer : 0))));
 
   38$moreparam = (isset($moreparam) ? $moreparam : 
'');
 
   39$value_public = $object->note_public;
 
   40$value_private = $object->note_private;
 
   43  if (
GETPOST(
'action', 
'aZ09') == 
'edit'.$note_public) {
 
   44    $value_public = 
dol_concatdesc($value_public, ($value_public ? 
"\n" : 
"").
"-- ".$stringtoadd);
 
   46      $value_public .= 
"<br>\n";
 
   48      $value_public .= 
"\n";
 
   54  if (
GETPOST(
'action', 
'aZ09') == 
'edit'.$note_private) {
 
   55    $value_private = 
dol_concatdesc($value_private, ($value_private ? 
"\n" : 
"").
"-- ".$stringtoadd);
 
   57      $value_private .= 
"<br>\n";
 
   59      $value_private .= 
"\n";
 
   65if ($module == 
'propal') {
 
   66  $permission = $user->hasRight(
"propal", 
"creer");
 
   67} elseif ($module == 
'supplier_proposal') {
 
   68  $permission = $user->hasRight(
"supplier_proposal", 
"creer");
 
   69} elseif ($module == 
'fichinter') {
 
   70  $permission = $user->hasRight(
"ficheinter", 
"creer");
 
   71} elseif ($module == 
'project') {
 
   72  $permission = $user->hasRight(
"projet", 
"creer");
 
   73} elseif ($module == 
'project_task') {
 
   74  $permission = $user->hasRight(
"projet", 
"creer");
 
   75} elseif ($module == 
'invoice_supplier') {
 
   77    $permission = $user->hasRight(
"fournisseur", 
"facture", 
"creer");
 
   79    $permission = $user->hasRight(
"supplier_invoice", 
"creer");
 
   81} elseif ($module == 
'order_supplier') {
 
   83    $permission = $user->hasRight(
"fournisseur", 
"commande", 
"creer");
 
   85    $permission = $user->hasRight(
"supplier_order", 
"creer");
 
   87} elseif ($module == 
'societe') {
 
   88  $permission = $user->hasRight(
"societe", 
"creer");
 
   89} elseif ($module == 
'contact') {
 
   90  $permission = $user->hasRight(
"societe", 
"creer");
 
   91} elseif ($module == 
'shipping') {
 
   92  $permission = $user->hasRight(
"expedition", 
"creer");
 
   93} elseif ($module == 
'product') {
 
   94  $permission = $user->hasRight(
"product", 
"creer");
 
   95} elseif ($module == 
'service') {
 
   96  $permission = $user->hasRight(
"service", 
"creer");
 
   97} elseif ($module == 
'ecmfiles') {
 
   98  $permission = $user->hasRight(
"ecm", 
"setup");
 
   99} elseif ($module == 
'user') {
 
  100  $permission = $user->hasRight(
"user", 
"self", 
"write");
 
  105  $typeofdatapub = 
'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; 
 
  107  $typeofdatapub = 
'textarea:12:95%';
 
  109if (isModEnabled(
'fckeditor') && 
getDolGlobalString(
'FCKEDITOR_ENABLE_NOTE_PRIVATE')) {
 
  110  $typeofdatapriv = 
'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; 
 
  112  $typeofdatapriv = 
'textarea:12:95%';
 
  115print 
'<!-- BEGIN PHP TEMPLATE NOTES -->'.
"\n";
 
  116print 
'<div class="tagtable border table-border tableforfield centpercent">'.
"\n";
 
  117print 
'<div class="tagtr table-border-row">'.
"\n";
 
  118$editmode = (
GETPOST(
'action', 
'aZ09') == 
'edit'.$note_public);
 
  119print 
'<div class="tagtd tagtdnote tdtop'.($editmode ? 
'' : 
' sensiblehtmlcontent').
' table-key-border-col'.(empty($cssclass) ? 
'' : 
' '.$cssclass).
'"'.($colwidth ? 
' style="width: '.$colwidth.
'%"' : 
'').
'>'.
"\n";
 
  120print $form->editfieldkey(
"NotePublic", $note_public, $value_public, $object, $permission, $typeofdatapub, $moreparam, 
'', 0);
 
  122print 
'<div class="tagtd wordbreak table-val-border-col'.($editmode ? 
'' : 
' sensiblehtmlcontent').
'">'.
"\n";
 
  123print $form->editfieldval(
"NotePublic", $note_public, $value_public, $object, $permission, $typeofdatapub, 
'', 
null, 
null, $moreparam, 1).
"\n";
 
  126if (empty($user->socid)) {
 
  128  print 
'<div class="tagtr table-border-row">'.
"\n";
 
  129  $editmode = (
GETPOST(
'action', 
'aZ09') == 
'edit'.$note_private);
 
  130  print 
'<div class="tagtd tagtdnote tdtop'.($editmode ? 
'' : 
' sensiblehtmlcontent').
' table-key-border-col'.(empty($cssclass) ? 
'' : 
' '.$cssclass).
'"'.($colwidth ? 
' style="width: '.$colwidth.
'%"' : 
'').
'>'.
"\n";
 
  131  print $form->editfieldkey(
"NotePrivate", $note_private, $value_private, $object, $permission, $typeofdatapriv, $moreparam, 
'', 0);
 
  133  print 
'<div class="tagtd wordbreak table-val-border-col'.($editmode ? 
'' : 
' sensiblehtmlcontent').
'">'.
"\n";
 
  134  print $form->editfieldval(
"NotePrivate", $note_private, $value_private, $object, $permission, $typeofdatapriv, 
'', 
null, 
null, $moreparam, 1);
 
  140<!-- END PHP TEMPLATE NOTES-->
 
const TYPE_SERVICE
Service.
 
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
 
dol_now($mode='auto')
Return date for now.
 
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
 
dol_textishtml($msg, $option=0)
Return if a text is a html content.
 
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
 
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.