21 if (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';
32 $colwidth = (isset($colwidth) ? $colwidth : (empty($cssclass) ?
'25' :
''));
34 $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))));
35 $moreparam = (isset($moreparam) ? $moreparam :
'');
36 $value_public = $object->note_public;
37 $value_private = $object->note_private;
38 if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PUBLIC_NOTES)) {
40 if (
GETPOST(
'action',
'aZ09') ==
'edit'.$note_public) {
41 $value_public =
dol_concatdesc($value_public, ($value_public ?
"\n" :
"").
"-- ".$stringtoadd);
43 $value_public .=
"<br>\n";
45 $value_public .=
"\n";
49 if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) {
51 if (
GETPOST(
'action',
'aZ09') ==
'edit'.$note_private) {
52 $value_private =
dol_concatdesc($value_private, ($value_private ?
"\n" :
"").
"-- ".$stringtoadd);
54 $value_private .=
"<br>\n";
56 $value_private .=
"\n";
62 if ($module ==
'propal') {
63 $permission = $user->rights->propale->creer;
64 } elseif ($module ==
'supplier_proposal') {
65 $permission = $user->rights->supplier_proposal->creer;
66 } elseif ($module ==
'fichinter') {
67 $permission = $user->rights->ficheinter->creer;
68 } elseif ($module ==
'project') {
69 $permission = $user->rights->projet->creer;
70 } elseif ($module ==
'project_task') {
71 $permission = $user->rights->projet->creer;
72 } elseif ($module ==
'invoice_supplier') {
73 if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
74 $permission = $user->rights->fournisseur->facture->creer;
76 $permission = $user->rights->supplier_invoice->creer;
78 } elseif ($module ==
'order_supplier') {
79 if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
80 $permission = $user->rights->fournisseur->commande->creer;
82 $permission = $user->rights->supplier_order->creer;
84 } elseif ($module ==
'societe') {
85 $permission = $user->rights->societe->creer;
86 } elseif ($module ==
'contact') {
87 $permission = $user->rights->societe->creer;
88 } elseif ($module ==
'shipping') {
89 $permission = $user->rights->expedition->creer;
90 } elseif ($module ==
'product') {
91 $permission = $user->rights->produit->creer;
92 } elseif ($module ==
'ecmfiles') {
93 $permission = $user->rights->ecm->setup;
97 if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) {
98 $typeofdata =
'ckeditor:dolibarr_notes:100%:200::1:12:95%:0';
100 $typeofdata =
'textarea:12:95%';
102 if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC)) {
103 $typeofdatapub =
'ckeditor:dolibarr_notes:100%:200::1:12:95%:0';
105 $typeofdatapub =
'textarea:12:95%';
107 if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE)) {
108 $typeofdatapriv =
'ckeditor:dolibarr_notes:100%:200::1:12:95%:0';
110 $typeofdatapriv =
'textarea:12:95%';
113 print
'<!-- BEGIN PHP TEMPLATE NOTES -->'.
"\n";
114 print
'<div class="tagtable border table-border tableforfield centpercent">'.
"\n";
115 print
'<div class="tagtr table-border-row">'.
"\n";
116 $editmode = (
GETPOST(
'action',
'aZ09') ==
'edit'.$note_public);
117 print
'<div class="tagtd tagtdnote tdtop'.($editmode ?
'' :
' sensiblehtmlcontent').
' table-key-border-col'.(empty($cssclass) ?
'' :
' '.$cssclass).
'"'.($colwidth ?
' style="width: '.$colwidth.
'%"' :
'').
'>'.
"\n";
118 print
$form->editfieldkey(
"NotePublic", $note_public, $value_public, $object, $permission, $typeofdatapub, $moreparam,
'', 0);
120 print
'<div class="tagtd wordbreak table-val-border-col'.($editmode ?
'' :
' sensiblehtmlcontent').
'">'.
"\n";
121 print
$form->editfieldval(
"NotePublic", $note_public, $value_public, $object, $permission, $typeofdatapub,
'', null, null, $moreparam, 1).
"\n";
124 if (empty($user->socid)) {
126 print
'<div class="tagtr table-border-row">'.
"\n";
127 $editmode = (
GETPOST(
'action',
'aZ09') ==
'edit'.$note_private);
128 print
'<div class="tagtd tagtdnote tdtop'.($editmode ?
'' :
' sensiblehtmlcontent').
' table-key-border-col'.(empty($cssclass) ?
'' :
' '.$cssclass).
'"'.($colwidth ?
' style="width: '.$colwidth.
'%"' :
'').
'>'.
"\n";
129 print
$form->editfieldkey(
"NotePrivate", $note_private, $value_private, $object, $permission, $typeofdatapriv, $moreparam,
'', 0);
131 print
'<div class="tagtd wordbreak table-val-border-col'.($editmode ?
'' :
' sensiblehtmlcontent').
'">'.
"\n";
132 print
$form->editfieldval(
"NotePrivate", $note_private, $value_private, $object, $permission, $typeofdatapriv,
'', null, null, $moreparam, 1);
138 <!-- END PHP TEMPLATE NOTES-->
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
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_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_textishtml($msg, $option=0)
Return if a text is a html content.