dolibarr 23.0.3
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 * Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 *
20 * Need to have the following variables defined:
21 * $object (invoice, order, ...)
22 * $action
23 * $conf
24 * $langs
25 * $parameters
26 */
27
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@phan-var-force CommonObject $object
46@phan-var-force string $action
47@phan-var-force Conf $conf
48@phan-var-force Translate $langs
49@phan-var-force array<string,mixed> $parameters
50';
51
52?>
53<!-- BEGIN PHP TEMPLATE extrafields_edit.tpl.php -->
54<?php
55
56// Other attributes
57if (!isset($parameters)) {
58 $parameters = array();
59}
60'
61@phan-var-force CommonObject $object
62@phan-var-force string $action
63@phan-var-force Conf $conf
64@phan-var-force Translate $conf
65@phan-var-force array<string,mixed> $parameters
66@phan-var-force ?string $tpl_context
67';
68
69$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
70print $hookmanager->resPrint;
71if (empty($reshook)) {
72 $params = array();
73 if (isset($tpl_context)) {
74 $params['tpl_context'] = $tpl_context;
75 }
76 $params['cols'] = array_key_exists('colspanvalue', $parameters) ? $parameters['colspanvalue'] : null;
77
78 print $object->showOptionals($extrafields, 'edit', $params);
79}
80
81?>
82<!-- END PHP TEMPLATE extrafields_edit.tpl.php -->
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100