dolibarr 24.0.0-beta
resource_add.tpl.php
Go to the documentation of this file.
1<!-- BEGIN TEMPLATE resource_add.tpl.php -->
2<?php
3/* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 * Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
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
34'
35@phan-var-force string $element
36@phan-var-force int $element_id
37@phan-var-force string $element_ref
38';
39// Protection to avoid direct call of template
40if (empty($conf) || !is_object($conf)) {
41 print "Error, template page can't be called as URL";
42 exit(1);
43}
44
45
46require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php';
47
48$form = new Form($db);
49$formresources = new FormResource($db);
50
51$out = '';
52
53$out .= '<div class="centpercent allwidth nohover">';
54
55$out .= '<form class="nohover '.(!empty($var) && $var == true ? 'pair' : 'impair').'" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
56$out .= '<input type="hidden" name="token" value="'.newToken().'">';
57$out .= '<input type="hidden" name="action" value="add_element_resource">';
58$out .= '<input type="hidden" name="element" value="'.$element.'">';
59$out .= '<input type="hidden" name="element_id" value="'.$element_id.'">';
60$out .= '<input type="hidden" name="ref" value="'.$element_ref.'">';
61$out .= '<input type="hidden" name="resource_type" value="'.(empty($resource_type) ? 'dolresource' : $resource_type).'">';
62
63$out .= '<div class="noborder borderbottom">';
64
65// Place
66$out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">'.$langs->trans("SelectResource").'</div>';
67$out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
68$events = array();
69$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
70$out .= $formresources->select_resource_list(0, 'fk_resource', '', 1, 1, 0, $events, '', 2, 0);
71$out .= '</div>';
72
73$out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block marginleftonly"><label for="resbusy">'.$langs->trans('Busy').'</label> ';
74//$out .= $form->selectyesno('busy', (GETPOSTISSET('busy') ? GETPOST('busy') : 1), 1);
75$out .= '<input type="checkbox" id="resbusy" name="busy" value="1"'.(GETPOSTISSET('fk_resource') ? (GETPOST('busy') ? ' checked' : '') : ' checked').'>';
76$out .= '</div>';
77$out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block marginleftonly"><label for="resmandatory">'.$langs->trans('Mandatory').'</label> ';
78//$out .= $form->selectyesno('mandatory', (GETPOSTISSET('mandatory') ? GETPOST('mandatory') : 0), 1);
79$out .= '<input type="checkbox" id="resmandatory" name="mandatory" value="1"'.(GETPOSTISSET('fk_resource') ? (GETPOST('mandatory') ? ' checked' : '') : ' checked').'>';
80$out .= '</div>';
81
82$out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block right">';
83$out .= '<input type="submit" id="add-resource-place" class="button button-add small" value="'.$langs->trans("Add").'"/>';
84$out .= '</div>';
85
86$out .= '</div>';
87
88$out .= '</form>';
89
90$out .= '</div>';
91$out .= '<br>';
92
93print $out;
94?>
95<!-- END TEMPLATE resource_add.tpl.php -->
Class to manage generation of HTML components Only common components must be here.
Class to manage forms for the module resource.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.