dolibarr 21.0.0-beta
extrafields_add.tpl.php
1<?php
2/* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
3 * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
4 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 *
19 * Need to have the following variables defined:
20 * $object (invoice, order, ...)
21 * $action
22 * $conf
23 * $langs
24 *
25 * $parameters
26 * $cols
27 */
28
38// Protection to avoid direct call of template
39if (empty($conf) || !is_object($conf)) {
40 print "Error, template page can't be called as URL";
41 exit(1);
42}
43
44?>
45<!-- BEGIN PHP TEMPLATE extrafields_add.tpl.php -->
46<?php
47
48// Other attributes
49if (!isset($parameters)) {
50 $parameters = array();
51}
52'
53@phan-var-force CommonObject $object
54@phan-var-force string $action
55@phan-var-force Conf $conf
56@phan-var-force Translate $conf
57@phan-var-force array<string,mixed> $parameters
58';
59
60$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
61print $hookmanager->resPrint;
62if (empty($reshook)) {
63 $params = array();
64 $params['cols'] = array_key_exists('colspanvalue', $parameters) ? $parameters['colspanvalue'] : '';
65 if (!empty($parameters['tdclass'])) {
66 $params['tdclass'] = $parameters['tdclass'];
67 }
68 if (!empty($parameters['tpl_context'])) {
69 $params['tpl_context'] = $parameters['tpl_context'];
70 }
71
72 print $object->showOptionals($extrafields, 'create', $params);
73}
74
75?>
76<!-- END PHP TEMPLATE extrafields_add.tpl.php -->
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79