41 print
"Error, template page can't be called as URL";
46@phan-var-force ?string $keyforbreak
48if (!is_object($form)) {
53<!-- BEGIN PHP TEMPLATE commonfields_view.tpl.php -->
58foreach (
$object->fields as $key => $val) {
59 if (isset($keyforbreak) && !empty($keyforbreak) && $key == $keyforbreak) {
64 if (abs($val[
'visible']) != 1 && abs($val[
'visible']) != 3 && abs($val[
'visible']) != 4 && abs($val[
'visible']) != 5) {
67 if (array_key_exists(
'enabled', $val) && isset($val[
'enabled']) && !
verifCond($val[
'enabled'])) {
71 if (in_array($key, array(
'rowid',
'ref',
'status'))) {
77 print
'<tr class="field_'.$key.
'"><td';
78 print
' class="'.(empty($val[
'tdcss']) ?
'titlefieldmiddle' : $val[
'tdcss']).
' fieldname_'.$key;
80 if ($val[
'type'] ==
'text' || $val[
'type'] ==
'html') {
86 if (!empty($val[
'help'])) {
87 $labeltoshow .= $form->textwithpicto($langs->trans($val[
'label']), $langs->trans($val[
'help']));
89 if (isset($val[
'copytoclipboard']) && $val[
'copytoclipboard'] == 1) {
90 $labeltoshow .= showValueWithClipboardCPButton($value, 0, $langs->transnoentitiesnoconv($val[
'label']));
92 $labeltoshow .= $langs->trans($val[
'label']);
95 if (empty($val[
'alwayseditable'])) {
98 print $form->editfieldkey($labeltoshow, $key, $value,
$object, 1, $val[
'type']);
102 print
'<td class="valuefield fieldname_'.$key;
103 if ($val[
'type'] ==
'text') {
106 if (!empty($val[
'cssview'])) {
107 print
' '.$val[
'cssview'];
110 if (empty($val[
'alwayseditable'])) {
111 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
112 print
'<div class="longmessagecut">';
114 if ($key ==
'lang') {
115 $langs->load(
"languages");
116 $labellang = ($value ? $langs->trans(
'Language_'.$value) :
'');
120 if (isset($val[
'copytoclipboard']) && $val[
'copytoclipboard'] == 2) {
121 $out =
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
122 print showValueWithClipboardCPButton($out, 0, $out);
124 print
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
128 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
132 print $form->editfieldval($labeltoshow, $key, $value,
$object, 1, $val[
'type']);
146foreach (
$object->fields as $key => $val) {
147 if ($alreadyoutput) {
148 if (isset($keyforbreak) && !empty($keyforbreak) && $key == $keyforbreak) {
156 if (abs($val[
'visible']) != 1 && abs($val[
'visible']) != 3 && abs($val[
'visible']) != 4 && abs($val[
'visible']) != 5) {
160 if (array_key_exists(
'enabled', $val) && isset($val[
'enabled']) && !$val[
'enabled']) {
163 if (in_array($key, array(
'ref',
'status'))) {
169 $rightpart .=
'<tr><td';
170 $rightpart .=
' class="'.(empty($val[
'tdcss']) ?
'titlefieldmiddle' : $val[
'tdcss']).
' fieldname_'.$key;
172 if ($val[
'type'] ==
'text' || $val[
'type'] ==
'html') {
173 $rightpart .=
' tdtop';
177 if (!empty($val[
'help'])) {
178 $labeltoshow .= $form->textwithpicto($langs->trans($val[
'label']), $langs->trans($val[
'help']));
180 if (isset($val[
'copytoclipboard']) && $val[
'copytoclipboard'] == 1) {
181 $labeltoshow .= showValueWithClipboardCPButton($value, 0, $langs->transnoentitiesnoconv($val[
'label']));
183 $labeltoshow .= $langs->trans($val[
'label']);
186 if (empty($val[
'alwayseditable'])) {
187 $rightpart .= $labeltoshow;
189 $rightpart .= $form->editfieldkey($labeltoshow, $key, $value,
$object, 1, $val[
'type']);
191 $rightpart .=
'</td>';
192 $rightpart .=
'<td class="valuefield fieldname_'.$key;
193 if ($val[
'type'] ==
'text') {
194 $rightpart .=
' wordbreak';
196 if (!empty($val[
'cssview'])) {
197 $rightpart .=
' '.$val[
'cssview'];
201 if (empty($val[
'alwayseditable'])) {
202 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
203 $rightpart .=
'<div class="longmessagecut">';
205 if ($key ==
'lang') {
206 $langs->load(
"languages");
207 $labellang = ($value ? $langs->trans(
'Language_'.$value) :
'');
208 $rightpart .=
picto_from_langcode($value,
'class="paddingrightonly saturatemedium opacitylow"');
209 $rightpart .= $labellang;
211 if (isset($val[
'copytoclipboard']) && $val[
'copytoclipboard'] == 2) {
212 $out =
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
213 $rightpart .= showValueWithClipboardCPButton($out, 0, $out);
215 $rightpart .=
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
218 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
219 $rightpart .=
'</div>';
222 $rightpart .= $form->editfieldval($labeltoshow, $key, $value,
$object, 1, $val[
'type']);
225 $rightpart .=
'</td>';
226 $rightpart .=
'</tr>';
230print
'<div class="fichehalfright">';
231if (empty($nounderbanner)) {
232 print
'<div class="underbanner clearboth"></div>';
234print
'<table class="border centpercent tableforfield">';
239<!-- END PHP TEMPLATE commonfields_view.tpl.php -->
if(! $sortfield) if(! $sortorder) $object
verifCond($strToEvaluate, $onlysimplestring='1')
Verify if condition in string is ok or not.
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...