26if (empty($conf) || !is_object($conf)) {
27 print
"Error, template page can't be called as URL";
32<!-- BEGIN PHP TEMPLATE commonfields_add.tpl.php -->
37foreach ($object->fields as $key => $val) {
39 if (abs($val[
'visible']) != 1 && abs($val[
'visible']) != 3) {
43 if (array_key_exists(
'enabled', $val) && isset($val[
'enabled']) && !
verifCond($val[
'enabled'])) {
47 print
'<tr class="field_'.$key.
'">';
49 print
' class="titlefieldcreate';
50 if (isset($val[
'notnull']) && $val[
'notnull'] > 0) {
51 print
' fieldrequired';
53 if ($val[
'type'] ==
'text' || $val[
'type'] ==
'html') {
58 if (!empty($val[
'help'])) {
59 print $form->textwithpicto($langs->trans($val[
'label']), $langs->trans($val[
'help']));
61 print $langs->trans($val[
'label']);
64 print
'<td class="valuefieldcreate">';
65 if (!empty($val[
'picto'])) {
66 print
img_picto(
'', $val[
'picto'],
'',
false, 0, 0,
'',
'pictofixedwidth');
68 if (in_array($val[
'type'], array(
'int',
'integer'))) {
70 } elseif ($val[
'type'] ==
'double') {
72 } elseif (preg_match(
'/^text/', $val[
'type'])) {
73 $tmparray = explode(
':', $val[
'type']);
74 if (!empty($tmparray[1])) {
75 $check = $tmparray[1];
80 } elseif (preg_match(
'/^html/', $val[
'type'])) {
81 $tmparray = explode(
':', $val[
'type']);
82 if (!empty($tmparray[1])) {
83 $check = $tmparray[1];
85 $check =
'restricthtml';
88 } elseif ($val[
'type'] ==
'date') {
90 } elseif ($val[
'type'] ==
'datetime') {
91 $value =
dol_mktime(
GETPOST($key.
'hour',
'int'),
GETPOST($key.
'min',
'int'), 0,
GETPOST($key.
'month',
'int'),
GETPOST($key.
'day',
'int'),
GETPOST($key.
'year',
'int'));
92 } elseif ($val[
'type'] ==
'boolean') {
93 $value = (
GETPOST($key) ==
'on' ? 1 : 0);
94 } elseif ($val[
'type'] ==
'price') {
96 } elseif ($key ==
'lang') {
99 $value =
GETPOST($key,
'alphanohtml');
101 if (!empty($val[
'noteditable'])) {
102 print $object->showOutputField($val, $key, $value,
'',
'',
'', 0);
104 if ($key ==
'lang') {
105 print
img_picto(
'',
'language',
'class="pictofixedwidth"');
106 print $formadmin->select_language($value, $key, 0,
null, 1, 0, 0,
'minwidth300', 2);
108 print $object->showInputField($val, $key, $value,
'',
'',
'', 0);
116<!-- END PHP TEMPLATE commonfields_add.tpl.php -->
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
verifCond($strToEvaluate)
Verify if condition in string is ok or not.