25 if (empty($conf) || !is_object($conf))
27 print "Error, template page can't be called as URL";
30 if (!is_object($form)) $form =
new Form($db);
33 <!-- BEGIN PHP TEMPLATE commonfields_edit.tpl.php -->
38 foreach ($object->fields as $key => $val)
41 if (abs($val[
'visible']) != 1 && abs($val[
'visible']) != 3 && abs($val[
'visible']) != 4)
continue;
43 if (array_key_exists(
'enabled', $val) && isset($val[
'enabled']) && !
verifCond($val[
'enabled']))
continue;
46 print ' class="titlefieldcreate';
47 if ($val[
'notnull'] > 0)
print ' fieldrequired';
48 if (preg_match(
'/^(text|html)/', $val[
'type']))
print ' tdtop';
50 if (!empty($val[
'help']))
print $form->textwithpicto($langs->trans($val[
'label']), $langs->trans($val[
'help']));
51 else print $langs->trans($val[
'label']);
55 if (in_array($val[
'type'], array(
'int',
'integer'))) $value =
GETPOSTISSET($key) ?
GETPOST($key,
'int') : $object->$key;
56 elseif (preg_match(
'/^(text|html)/', $val[
'type'])) {
57 $tmparray = explode(
':', $val[
'type']);
58 if (!empty($tmparray[1])) {
59 $check = $tmparray[1];
61 $check =
'restricthtml';
67 if ($val[
'noteditable'])
print $object->showOutputField($val, $key, $value,
'',
'',
'', 0);
68 else print $object->showInputField($val, $key, $value,
'',
'',
'', 0);
74 <!-- END PHP TEMPLATE commonfields_edit.tpl.php -->
verifCond($strRights)
Verify if condition in string is ok or not.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
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...
print
Draft customers invoices.