26 if (empty($conf) || !is_object($conf)) {
27 print
"Error, template page can't be called as URL";
32 <!-- BEGIN PHP TEMPLATE commonfields_add.tpl.php -->
37 foreach ($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 ($val[
'type'] ==
'text' || $val[
'type'] ==
'html') {
73 $value =
GETPOST($key,
'restricthtml');
74 } elseif ($val[
'type'] ==
'date') {
76 } elseif ($val[
'type'] ==
'datetime') {
77 $value =
dol_mktime(
GETPOST($key.
'hour',
'int'),
GETPOST($key.
'min',
'int'), 0,
GETPOST($key.
'month',
'int'),
GETPOST($key.
'day',
'int'),
GETPOST($key.
'year',
'int'));
78 } elseif ($val[
'type'] ==
'boolean') {
79 $value = (
GETPOST($key) ==
'on' ? 1 : 0);
80 } elseif ($val[
'type'] ==
'price') {
82 } elseif ($key ==
'lang') {
85 $value =
GETPOST($key,
'alphanohtml');
87 if (!empty($val[
'noteditable'])) {
88 print $object->showOutputField($val, $key, $value,
'',
'',
'', 0);
91 print
img_picto(
'',
'language',
'class="pictofixedwidth"');
92 print $formadmin->select_language($value, $key, 0,
null, 1, 0, 0,
'minwidth300', 2);
94 print $object->showInputField($val, $key, $value,
'',
'',
'', 0);
102 <!-- END PHP TEMPLATE commonfields_add.tpl.php -->
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.