27if (empty($conf) || !is_object($conf)) {
28 print
"Error, template page can't be called as URL";
31if (!is_object($form)) {
32 $form =
new Form($db);
36<!-- BEGIN PHP TEMPLATE commonfields_view.tpl.php -->
41foreach (
$object->fields as $key => $val) {
42 if (!empty($keyforbreak) && $key == $keyforbreak) {
47 if (abs($val[
'visible']) != 1 && abs($val[
'visible']) != 3 && abs($val[
'visible']) != 4 && abs($val[
'visible']) != 5) {
50 if (array_key_exists(
'enabled', $val) && isset($val[
'enabled']) && !
verifCond($val[
'enabled'])) {
54 if (in_array($key, array(
'ref',
'status'))) {
60 print
'<tr class="field_'.$key.
'"><td';
61 print
' class="'.(empty($val[
'tdcss']) ?
'titlefield' : $val[
'tdcss']).
' fieldname_'.$key;
63 if ($val[
'type'] ==
'text' || $val[
'type'] ==
'html') {
69 if (!empty($val[
'help'])) {
70 $labeltoshow .= $form->textwithpicto($langs->trans($val[
'label']), $langs->trans($val[
'help']));
72 if (isset($val[
'copytoclipboard']) && $val[
'copytoclipboard'] == 1) {
75 $labeltoshow .= $langs->trans($val[
'label']);
78 if (empty($val[
'alwayseditable'])) {
81 print $form->editfieldkey($labeltoshow, $key, $value,
$object, 1, $val[
'type']);
85 print
'<td class="valuefield fieldname_'.$key;
86 if ($val[
'type'] ==
'text') {
89 if (!empty($val[
'cssview'])) {
90 print
' '.$val[
'cssview'];
93 if (empty($val[
'alwayseditable'])) {
94 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
95 print
'<div class="longmessagecut">';
98 $langs->load(
"languages");
99 $labellang = ($value ? $langs->trans(
'Language_'.$value) :
'');
103 if (isset($val[
'copytoclipboard']) && $val[
'copytoclipboard'] == 2) {
104 $out =
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
107 print
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
111 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
115 print $form->editfieldval($labeltoshow, $key, $value,
$object, 1, $val[
'type']);
129foreach (
$object->fields as $key => $val) {
130 if ($alreadyoutput) {
131 if (!empty($keyforbreak) && $key == $keyforbreak) {
139 if (abs($val[
'visible']) != 1 && abs($val[
'visible']) != 3 && abs($val[
'visible']) != 4 && abs($val[
'visible']) != 5) {
143 if (array_key_exists(
'enabled', $val) && isset($val[
'enabled']) && !$val[
'enabled']) {
146 if (in_array($key, array(
'ref',
'status'))) {
152 $rightpart .=
'<tr><td';
153 $rightpart .=
' class="'.(empty($val[
'tdcss']) ?
'titlefield' : $val[
'tdcss']).
' fieldname_'.$key;
155 if ($val[
'type'] ==
'text' || $val[
'type'] ==
'html') {
156 $rightpart .=
' tdtop';
160 if (!empty($val[
'help'])) {
161 $labeltoshow .= $form->textwithpicto($langs->trans($val[
'label']), $langs->trans($val[
'help']));
163 if (isset($val[
'copytoclipboard']) && $val[
'copytoclipboard'] == 1) {
166 $labeltoshow .= $langs->trans($val[
'label']);
169 if (empty($val[
'alwayseditable'])) {
170 $rightpart .= $labeltoshow;
172 $rightpart .= $form->editfieldkey($labeltoshow, $key, $value,
$object, 1, $val[
'type']);
174 $rightpart .=
'</td>';
175 $rightpart .=
'<td class="valuefield fieldname_'.$key;
176 if ($val[
'type'] ==
'text') {
177 $rightpart .=
' wordbreak';
179 if (!empty($val[
'cssview'])) {
180 $rightpart .=
' '.$val[
'cssview'];
184 if (empty($val[
'alwayseditable'])) {
185 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
186 $rightpart .=
'<div class="longmessagecut">';
188 if ($key ==
'lang') {
189 $langs->load(
"languages");
190 $labellang = ($value ? $langs->trans(
'Language_'.$value) :
'');
191 $rightpart .=
picto_from_langcode($value,
'class="paddingrightonly saturatemedium opacitylow"');
192 $rightpart .= $labellang;
194 if (isset($val[
'copytoclipboard']) && $val[
'copytoclipboard'] == 2) {
195 $out =
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
198 $rightpart.=
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
201 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
202 $rightpart .=
'</div>';
205 $rightpart .= $form->editfieldval($labeltoshow, $key, $value,
$object, 1, $val[
'type']);
208 $rightpart .=
'</td>';
209 $rightpart .=
'</tr>';
213print
'<div class="fichehalfright">';
214print
'<div class="underbanner clearboth"></div>';
216print
'<table class="border centpercent tableforfield">';
221<!-- END PHP TEMPLATE commonfields_view.tpl.php -->
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
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...