dolibarr 21.0.0-beta
extrafields_edit.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 * $parameters
25 */
26
37// Protection to avoid direct call of template
38if (empty($conf) || !is_object($conf)) {
39 print "Error, template page can't be called as URL";
40 exit(1);
41}
42
43'
44@phan-var-force CommonObject $object
45@phan-var-force string $action
46@phan-var-force Conf $conf
47@phan-var-force Translate $langs
48@phan-var-force array<string,mixed> $parameters
49';
50
51?>
52<!-- BEGIN PHP TEMPLATE extrafields_edit.tpl.php -->
53<?php
54
55// Other attributes
56if (!isset($parameters)) {
57 $parameters = array();
58}
59'
60@phan-var-force CommonObject $object
61@phan-var-force string $action
62@phan-var-force Conf $conf
63@phan-var-force Translate $conf
64@phan-var-force array<string,mixed> $parameters
65';
66
67$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
68print $hookmanager->resPrint;
69if (empty($reshook)) {
70 $params = array();
71 if (isset($tpl_context)) {
72 $params['tpl_context'] = $tpl_context;
73 }
74 $params['cols'] = array_key_exists('colspanvalue', $parameters) ? $parameters['colspanvalue'] : null;
75
76 print $object->showOptionals($extrafields, 'edit', $params);
77}
78
79?>
80<!-- END PHP TEMPLATE extrafields_edit.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