dolibarr  17.0.4
skilldet.fiche.tpl.php
1 <?php
2 
3 // Protection to avoid direct call of template
4 if (empty($object) || !is_object($object)) {
5  print "Error, template page can't be called as URL";
6  exit;
7 }
8 /*
9 // $permissionnote must be defined by caller. For example $permissionnote=$user->rights->module->create
10 // $cssclass must be defined by caller. For example $cssclass='fieldtitle'
11 $module = $object->element;
12 $note_public = 'note_public';
13 $note_private = 'note_private';
14 
15 $colwidth = (isset($colwidth) ? $colwidth : (empty($cssclass) ? '25' : ''));
16 // Set $permission from the $permissionnote var defined on calling page
17 $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))));
18 $moreparam = (isset($moreparam) ? $moreparam : '');
19 $value_public = $object->note_public;
20 $value_private = $object->note_private;
21 if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PUBLIC_NOTES)) {
22 $stringtoadd = dol_print_date(dol_now(), 'dayhour').' '.$user->getFullName($langs).' --';
23 if (GETPOST('action', 'aZ09') == 'edit'.$note_public) {
24 $value_public = dol_concatdesc($value_public, ($value_public ? "\n" : "")."-- ".$stringtoadd);
25 if (dol_textishtml($value_public)) {
26 $value_public .= "<br>\n";
27 } else {
28 $value_public .= "\n";
29 }
30 }
31 }
32 if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) {
33 $stringtoadd = dol_print_date(dol_now(), 'dayhour').' '.$user->getFullName($langs).' --';
34 if (GETPOST('action', 'aZ09') == 'edit'.$note_private) {
35 $value_private = dol_concatdesc($value_private, ($value_private ? "\n" : "")."-- ".$stringtoadd);
36 if (dol_textishtml($value_private)) {
37 $value_private .= "<br>\n";
38 } else {
39 $value_private .= "\n";
40 }
41 }
42 }*/
43 /*
44 // Special cases
45 if ($module == 'propal') {
46 $permission = $user->rights->propal->creer;
47 } elseif ($module == 'supplier_proposal') {
48 $permission = $user->rights->supplier_proposal->creer;
49 } elseif ($module == 'fichinter') {
50 $permission = $user->rights->ficheinter->creer;
51 } elseif ($module == 'project') {
52 $permission = $user->rights->projet->creer;
53 } elseif ($module == 'project_task') {
54 $permission = $user->rights->projet->creer;
55 } elseif ($module == 'invoice_supplier') {
56 if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
57 $permission = $user->rights->fournisseur->facture->creer;
58 } else {
59 $permission = $user->rights->supplier_invoice->creer;
60 }
61 } elseif ($module == 'order_supplier') {
62 if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
63 $permission = $user->rights->fournisseur->commande->creer;
64 } else {
65 $permission = $user->rights->supplier_order->creer;
66 }
67 } elseif ($module == 'societe') {
68 $permission = $user->rights->societe->creer;
69 } elseif ($module == 'contact') {
70 $permission = $user->rights->societe->creer;
71 } elseif ($module == 'shipping') {
72 $permission = $user->rights->expedition->creer;
73 } elseif ($module == 'product') {
74 $permission = $user->rights->produit->creer;
75 } elseif ($module == 'ecmfiles') {
76 $permission = $user->rights->ecm->setup;
77 }*/
78 //else dol_print_error('','Bad value '.$module.' for param module');
79 
80 if (!empty($object->table_element_line)) {
81  // Show object lines
82  $result = $object->getLinesArray();
83 }
84 
85 
86 
87 print '<!-- BEGIN PHP TEMPLATE SKILLDET -->'."\n";
88 
89 print '<div class="tagtable border table-border tableforfield centpercent">'."\n";
90  print '<div class="tagtr table-border-row">'."\n";
91  $editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_public);
92  print '<div class="tagtd tagtdnote tdtop'.($editmode ? '' : ' sensiblehtmlcontent').' table-key-border-col'.(empty($cssclass) ? '' : ' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
93  print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0);
94  print '</div>'."\n";
95  print '<div class="tagtd wordbreak table-val-border-col'.($editmode ? '' : ' sensiblehtmlcontent').'">'."\n";
96  print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1)."\n";
97  print '</div>'."\n";
98  print '</div>'."\n";
99 if (empty($user->socid)) {
100  // Private notes (always hidden to external users)
101  print '<div class="tagtr table-border-row">'."\n";
102  $editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_private);
103  print '<div class="tagtd tagtdnote tdtop'.($editmode ? '' : ' sensiblehtmlcontent').' table-key-border-col'.(empty($cssclass) ? '' : ' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
104  print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0);
105  print '</div>'."\n";
106  print '<div class="tagtd wordbreak table-val-border-col'.($editmode ? '' : ' sensiblehtmlcontent').'">'."\n";
107  print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1);
108  print '</div>'."\n";
109  print '</div>'."\n";
110 }
111 print '</div>'."\n";
112 ?>
113 <!-- END PHP TEMPLATE NOTES-->
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.