dolibarr 21.0.0-alpha
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 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 *
18 * Need to have the following variables defined:
19 * $object (invoice, order, ...)
20 * $action
21 * $conf
22 * $langs
23 * $parameters
24 */
25
26// Protection to avoid direct call of template
27if (empty($conf) || !is_object($conf)) {
28 print "Error, template page can't be called as URL";
29 exit(1);
30}
31
32'
33@phan-var-force CommonObject $object
34@phan-var-force string $action
35@phan-var-force Conf $conf
36@phan-var-force Translate $langs
37@phan-var-force array<string,mixed> $parameters
38';
39
40?>
41<!-- BEGIN PHP TEMPLATE extrafields_edit.tpl.php -->
42<?php
43
44// Other attributes
45if (!isset($parameters)) {
46 $parameters = array();
47}
48'
49@phan-var-force CommonObject $object
50@phan-var-force string $action
51@phan-var-force Conf $conf
52@phan-var-force Translate $conf
53@phan-var-force array<string,mixed> $parameters
54';
55
56$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
57print $hookmanager->resPrint;
58if (empty($reshook)) {
59 $params = array();
60 if (isset($tpl_context)) {
61 $params['tpl_context'] = $tpl_context;
62 }
63 $params['cols'] = array_key_exists('colspanvalue', $parameters) ? $parameters['colspanvalue'] : null;
64
65 print $object->showOptionals($extrafields, 'edit', $params);
66}
67
68?>
69<!-- END PHP TEMPLATE extrafields_edit.tpl.php -->
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58