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_edit.tpl.php -->
52foreach (
$object->fields as $key => $val) {
54 if (abs($val[
'visible']) != 1 && abs($val[
'visible']) != 3 && abs($val[
'visible']) != 4) {
58 if (array_key_exists(
'enabled', $val) && isset($val[
'enabled']) && !
verifCond($val[
'enabled'])) {
62 print
'<tr class="field_'.$key.
'"><td';
63 print
' class="titlefieldcreate';
64 if (isset($val[
'notnull']) && $val[
'notnull'] > 0) {
65 print
' fieldrequired';
67 if (preg_match(
'/^(text|html)/', $val[
'type'])) {
71 if (!empty($val[
'help'])) {
72 print $form->textwithpicto($langs->trans($val[
'label']), $langs->trans($val[
'help']));
74 print $langs->trans($val[
'label']);
77 print
'<td class="valuefieldcreate">';
79 if (!empty($val[
'picto'])) {
80 print
img_picto(
'', $val[
'picto'],
'', 0, 0, 0,
'',
'pictofixedwidth');
83 if (in_array($val[
'type'], array(
'int',
'integer'))) {
85 } elseif ($val[
'type'] ==
'double') {
87 } elseif (preg_match(
'/^text/', $val[
'type'])) {
88 $tmparray = explode(
':', $val[
'type']);
89 if (!empty($tmparray[1])) {
90 $check = $tmparray[1];
94 $value = GETPOSTISSET($key) ?
GETPOST($key, $check) :
$object->$key;
95 } elseif (preg_match(
'/^html/', $val[
'type'])) {
96 $tmparray = explode(
':', $val[
'type']);
97 if (!empty($tmparray[1])) {
98 $check = $tmparray[1];
100 $check =
'restricthtml';
102 $value = GETPOSTISSET($key) ?
GETPOST($key, $check) :
$object->$key;
103 } elseif (in_array($val[
'type'], array(
'date',
'datetime'))) {
105 } elseif ($val[
'type'] ==
'price') {
107 } elseif ($key ==
'lang') {
109 $value = GETPOSTISSET($key) ?
GETPOST($key,
'aZ09') :
$object->lang;
111 $value = GETPOSTISSET($key) ?
GETPOST($key,
'alpha') :
$object->$key;
114 if (!empty($val[
'noteditable'])) {
115 print
$object->showOutputField($val, $key, $value,
'',
'',
'', 0);
117 if ($key ==
'lang') {
118 print
img_picto(
'',
'language',
'class="pictofixedwidth"');
119 print $formadmin->select_language($value, $key, 0, array(), 1, 0, 0,
'minwidth300', 2);
121 print
$object->showInputField($val, $key, $value,
'',
'',
'', 0);
129<!-- END PHP TEMPLATE commonfields_edit.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.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...