39 print
"Error, template page can't be called as URL";
42if (!is_object($form)) {
43 $form =
new Form($db);
47<!-- BEGIN PHP TEMPLATE commonfields_view.tpl.php -->
52foreach (
$object->fields as $key => $val) {
53 if (!empty($keyforbreak) && $key == $keyforbreak) {
58 if (abs($val[
'visible']) != 1 && abs($val[
'visible']) != 3 && abs($val[
'visible']) != 4 && abs($val[
'visible']) != 5) {
61 if (array_key_exists(
'enabled', $val) && isset($val[
'enabled']) && !
verifCond($val[
'enabled'])) {
65 if (in_array($key, array(
'rowid',
'ref',
'status'))) {
71 print
'<tr class="field_'.$key.
'"><td';
72 print
' class="'.(empty($val[
'tdcss']) ?
'titlefieldmiddle' : $val[
'tdcss']).
' fieldname_'.$key;
74 if ($val[
'type'] ==
'text' || $val[
'type'] ==
'html') {
80 if (!empty($val[
'help'])) {
81 $labeltoshow .= $form->textwithpicto($langs->trans($val[
'label']), $langs->trans($val[
'help']));
83 if (isset($val[
'copytoclipboard']) && $val[
'copytoclipboard'] == 1) {
86 $labeltoshow .= $langs->trans($val[
'label']);
89 if (empty($val[
'alwayseditable'])) {
92 print $form->editfieldkey($labeltoshow, $key, $value,
$object, 1, $val[
'type']);
96 print
'<td class="valuefield fieldname_'.$key;
97 if ($val[
'type'] ==
'text') {
100 if (!empty($val[
'cssview'])) {
101 print
' '.$val[
'cssview'];
104 if (empty($val[
'alwayseditable'])) {
105 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
106 print
'<div class="longmessagecut">';
108 if ($key ==
'lang') {
109 $langs->load(
"languages");
110 $labellang = ($value ? $langs->trans(
'Language_'.$value) :
'');
114 if (isset($val[
'copytoclipboard']) && $val[
'copytoclipboard'] == 2) {
115 $out =
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
118 print
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
122 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
126 print $form->editfieldval($labeltoshow, $key, $value,
$object, 1, $val[
'type']);
140foreach (
$object->fields as $key => $val) {
141 if ($alreadyoutput) {
142 if (!empty($keyforbreak) && $key == $keyforbreak) {
150 if (abs($val[
'visible']) != 1 && abs($val[
'visible']) != 3 && abs($val[
'visible']) != 4 && abs($val[
'visible']) != 5) {
154 if (array_key_exists(
'enabled', $val) && isset($val[
'enabled']) && !$val[
'enabled']) {
157 if (in_array($key, array(
'ref',
'status'))) {
163 $rightpart .=
'<tr><td';
164 $rightpart .=
' class="'.(empty($val[
'tdcss']) ?
'titlefield' : $val[
'tdcss']).
' fieldname_'.$key;
166 if ($val[
'type'] ==
'text' || $val[
'type'] ==
'html') {
167 $rightpart .=
' tdtop';
171 if (!empty($val[
'help'])) {
172 $labeltoshow .= $form->textwithpicto($langs->trans($val[
'label']), $langs->trans($val[
'help']));
174 if (isset($val[
'copytoclipboard']) && $val[
'copytoclipboard'] == 1) {
177 $labeltoshow .= $langs->trans($val[
'label']);
180 if (empty($val[
'alwayseditable'])) {
181 $rightpart .= $labeltoshow;
183 $rightpart .= $form->editfieldkey($labeltoshow, $key, $value,
$object, 1, $val[
'type']);
185 $rightpart .=
'</td>';
186 $rightpart .=
'<td class="valuefield fieldname_'.$key;
187 if ($val[
'type'] ==
'text') {
188 $rightpart .=
' wordbreak';
190 if (!empty($val[
'cssview'])) {
191 $rightpart .=
' '.$val[
'cssview'];
195 if (empty($val[
'alwayseditable'])) {
196 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
197 $rightpart .=
'<div class="longmessagecut">';
199 if ($key ==
'lang') {
200 $langs->load(
"languages");
201 $labellang = ($value ? $langs->trans(
'Language_'.$value) :
'');
202 $rightpart .=
picto_from_langcode($value,
'class="paddingrightonly saturatemedium opacitylow"');
203 $rightpart .= $labellang;
205 if (isset($val[
'copytoclipboard']) && $val[
'copytoclipboard'] == 2) {
206 $out =
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
209 $rightpart.=
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
212 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
213 $rightpart .=
'</div>';
216 $rightpart .= $form->editfieldval($labeltoshow, $key, $value,
$object, 1, $val[
'type']);
219 $rightpart .=
'</td>';
220 $rightpart .=
'</tr>';
224print
'<div class="fichehalfright">';
225if (empty($nounderbanner)) {
226 print
'<div class="underbanner clearboth"></div>';
228print
'<table class="border centpercent tableforfield">';
233<!-- 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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...