dolibarr  17.0.4
edit.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
3  * Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2009-2011 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr>
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 
27 // Load Dolibarr environment
28 require '../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
31 
32 // Load translation files required by the page
33 $langs->loadLangs(array("other", "admin"));
34 
35 $cancel = GETPOST('cancel', 'alphanohtml'); // We click on a Cancel button
36 $confirm = GETPOST('confirm');
37 
38 if (!$user->admin) {
40 }
41 
42 $dirstandard = array();
43 $dirsmartphone = array();
44 $dirmenus = array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']);
45 foreach ($dirmenus as $dirmenu) {
46  $dirstandard[] = $dirmenu.'standard';
47  $dirsmartphone[] = $dirmenu.'smartphone';
48 }
49 
50 $action = GETPOST('action', 'aZ09');
51 
52 $menu_handler_top = $conf->global->MAIN_MENU_STANDARD;
53 $menu_handler_smartphone = $conf->global->MAIN_MENU_SMARTPHONE;
54 $menu_handler_top = preg_replace('/_backoffice.php/i', '', $menu_handler_top);
55 $menu_handler_top = preg_replace('/_frontoffice.php/i', '', $menu_handler_top);
56 $menu_handler_smartphone = preg_replace('/_backoffice.php/i', '', $menu_handler_smartphone);
57 $menu_handler_smartphone = preg_replace('/_frontoffice.php/i', '', $menu_handler_smartphone);
58 
59 $menu_handler = $menu_handler_top;
60 
61 if (GETPOST("handler_origine")) {
62  $menu_handler = GETPOST("handler_origine");
63 }
64 if (GETPOST("menu_handler")) {
65  $menu_handler = GETPOST("menu_handler");
66 }
67 
68 
69 
70 /*
71  * Actions
72  */
73 
74 if ($action == 'update') {
75  if (!$cancel) {
76  $leftmenu = ''; $mainmenu = '';
77  if (GETPOST('menuIdParent', 'alphanohtml') && !is_numeric(GETPOST('menuIdParent', 'alphanohtml'))) {
78  $tmp = explode('&', GETPOST('menuIdParent', 'alphanohtml'));
79  foreach ($tmp as $s) {
80  if (preg_match('/fk_mainmenu=/', $s)) {
81  $mainmenu = preg_replace('/fk_mainmenu=/', '', $s);
82  }
83  if (preg_match('/fk_leftmenu=/', $s)) {
84  $leftmenu = preg_replace('/fk_leftmenu=/', '', $s);
85  }
86  }
87  }
88 
89  $menu = new Menubase($db);
90  $result = $menu->fetch(GETPOST('menuId', 'int'));
91  if ($result > 0) {
92  $menu->title = (string) GETPOST('titre', 'alphanohtml');
93  $menu->leftmenu = (string) GETPOST('leftmenu', 'aZ09');
94  $menu->url = (string) GETPOST('url', 'alphanohtml');
95  $menu->langs = (string) GETPOST('langs', 'alphanohtml');
96  $menu->position = (int) GETPOST('position', 'int');
97  $menu->enabled = (string) GETPOST('enabled', 'alphanohtml');
98  $menu->perms = (string) GETPOST('perms', 'alphanohtml');
99  $menu->target = (string) GETPOST('target', 'alphanohtml');
100  $menu->user = (string) GETPOST('user', 'alphanohtml');
101  $menu->mainmenu = (string) GETPOST('propertymainmenu', 'alphanohtml');
102  if (is_numeric(GETPOST('menuIdParent', 'alphanohtml'))) {
103  $menu->fk_menu = (int) GETPOST('menuIdParent', 'alphanohtml');
104  } else {
105  if (GETPOST('type', 'alphanohtml') == 'top') {
106  $menu->fk_menu = 0;
107  } else {
108  $menu->fk_menu = -1;
109  }
110  $menu->fk_mainmenu = $mainmenu;
111  $menu->fk_leftmenu = $leftmenu;
112  }
113 
114  $result = $menu->update($user);
115  if ($result > 0) {
116  setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
117  } else {
118  setEventMessages($menu->error, $menu->errors, 'errors');
119  }
120  } else {
121  setEventMessages($menu->error, $menu->errors, 'errors');
122  }
123  $action = "edit";
124 
125  header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler);
126  exit;
127  } else {
128  header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler);
129  exit;
130  }
131 }
132 
133 if ($action == 'add') {
134  if ($cancel) {
135  header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler);
136  exit;
137  }
138 
139  $leftmenu = '';
140  $mainmenu = '';
141  if (GETPOST('menuId', 'alphanohtml', 3) && !is_numeric(GETPOST('menuId', 'alphanohtml', 3))) {
142  $tmp = explode('&', GETPOST('menuId', 'alphanohtml', 3));
143  foreach ($tmp as $s) {
144  if (preg_match('/fk_mainmenu=/', $s)) {
145  $mainmenu = preg_replace('/fk_mainmenu=/', '', $s);
146  }
147  if (preg_match('/fk_leftmenu=/', $s)) {
148  $leftmenu = preg_replace('/fk_leftmenu=/', '', $s);
149  }
150  }
151  }
152 
153  $langs->load("errors");
154 
155  $error = 0;
156  if (!$error && !GETPOST('menu_handler')) {
157  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MenuHandler")), null, 'errors');
158  $action = 'create';
159  $error++;
160  }
161  if (!$error && !GETPOST('type')) {
162  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors');
163  $action = 'create';
164  $error++;
165  }
166  if (!$error && !GETPOST('url')) {
167  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("URL")), null, 'errors');
168  $action = 'create';
169  $error++;
170  }
171  if (!$error && !GETPOST('titre')) {
172  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Title")), null, 'errors');
173  $action = 'create';
174  $error++;
175  }
176  if (!$error && GETPOST('menuId', 'alphanohtml', 3) && GETPOST('type') == 'top') {
177  setEventMessages($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), null, 'errors');
178  $action = 'create';
179  $error++;
180  }
181  if (!$error && !GETPOST('menuId', 'alphanohtml', 3) && GETPOST('type') == 'left') {
182  setEventMessages($langs->trans("ErrorLeftMenuMustHaveAParentId"), null, 'errors');
183  $action = 'create';
184  $error++;
185  }
186 
187  if (!$error) {
188  $menu = new Menubase($db);
189  $menu->menu_handler = preg_replace('/_menu$/', '', GETPOST('menu_handler', 'aZ09'));
190  $menu->type = (string) GETPOST('type', 'alphanohtml');
191  $menu->title = (string) GETPOST('titre', 'alphanohtml');
192  $menu->url = (string) GETPOST('url', 'alphanohtml');
193  $menu->langs = (string) GETPOST('langs', 'alphanohtml');
194  $menu->position = (int) GETPOST('position', 'int');
195  $menu->enabled = (string) GETPOST('enabled', 'alphanohtml');
196  $menu->perms = (string) GETPOST('perms', 'alphanohtml');
197  $menu->target = (string) GETPOST('target', 'alphanohtml');
198  $menu->user = (string) GETPOST('user', 'alphanohtml');
199  $menu->mainmenu = (string) GETPOST('propertymainmenu', 'alphanohtml');
200  if (is_numeric(GETPOST('menuId', 'alphanohtml', 3))) {
201  $menu->fk_menu = (int) GETPOST('menuId', 'alphanohtml', 3);
202  } else {
203  if (GETPOST('type', 'alphanohtml') == 'top') {
204  $menu->fk_menu = 0;
205  } else {
206  $menu->fk_menu = -1;
207  }
208  $menu->fk_mainmenu = $mainmenu;
209  $menu->fk_leftmenu = $leftmenu;
210  }
211 
212  $result = $menu->create($user);
213  if ($result > 0) {
214  header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".GETPOST('menu_handler', 'aZ09'));
215  exit;
216  } else {
217  $action = 'create';
218  setEventMessages($menu->error, $menu->errors, 'errors');
219  }
220  }
221 }
222 
223 
224 
225 /*
226  * View
227  */
228 
229 $form = new Form($db);
230 $formadmin = new FormAdmin($db);
231 
232 llxHeader('', $langs->trans("Menu"));
233 
234 
235 if ($action == 'create') {
236  print '<script type="text/javascript">
237  jQuery(document).ready(function() {
238  function init_topleft()
239  {
240  if (jQuery("#topleft").val() == \'top\')
241  {
242  jQuery("#menuId").prop("disabled", true);
243  jQuery("#menuId").val(\'\');
244  jQuery("#propertymainmenu").removeAttr("disabled");
245  jQuery("#propertymainmenu").val(\'\');
246  }
247  if (jQuery("#topleft").val() == \'left\')
248  {
249  jQuery("#menuId").removeAttr("disabled");
250  jQuery("#propertymainmenu").prop("disabled", true);
251  }
252  }
253  init_topleft();
254  jQuery("#topleft").click(function() {
255  init_topleft();
256  });
257  });
258  </script>';
259 
260  print load_fiche_titre($langs->trans("NewMenu"), '', 'title_setup');
261 
262  print '<form action="'.DOL_URL_ROOT.'/admin/menus/edit.php?action=add&token='.newToken().'&menuId='.GETPOST('menuId', 'int').'" method="post" name="formmenucreate">';
263  print '<input type="hidden" name="token" value="'.newToken().'">';
264 
265  print dol_get_fiche_head();
266 
267  print '<table class="border centpercent">';
268 
269  // Id
270  $parent_rowid = GETPOST('menuId', 'int');
271  $parent_mainmenu = '';
272  $parent_leftmenu = '';
273  $parent_langs = '';
274  $parent_level = '';
275 
276  if (GETPOST('menuId', 'int')) {
277  $sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs FROM ".MAIN_DB_PREFIX."menu as m WHERE m.rowid = ".GETPOST('menuId', 'int');
278  $res = $db->query($sql);
279  if ($res) {
280  while ($menu = $db->fetch_array($res)) {
281  $parent_rowid = $menu['rowid'];
282  $parent_mainmenu = $menu['mainmenu'];
283  $parent_leftmenu = $menu['leftmenu'];
284  $parent_langs = $menu['langs'];
285  $parent_level = $menu['level'];
286  }
287  }
288  }
289 
290  // Handler
291  print '<tr><td class="fieldrequired">'.$langs->trans('MenuHandler').'</td>';
292  print '<td>';
293  $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/', $menu_handler) ? '' : '_menu'), 'menu_handler', array_merge($dirstandard, $dirsmartphone));
294  print '</td>';
295  print '<td>'.$langs->trans('DetailMenuHandler').'</td></tr>';
296 
297  // User
298  print '<tr><td class="nowrap fieldrequired">'.$langs->trans('MenuForUsers').'</td>';
299  print '<td><select class="flat" name="user" id="menuuser">';
300  print '<option value="2" selected>'.$langs->trans("AllMenus").'</option>';
301  print '<option value="0">'.$langs->trans('Internal').'</option>';
302  print '<option value="1">'.$langs->trans('External').'</option>';
303  print '</select>';
304  print ajax_combobox('menuuser');
305  print '</td>';
306  print '<td>'.$langs->trans('DetailUser').'</td></tr>';
307 
308  // Type
309  print '<tr><td class="fieldrequired">'.$langs->trans('Position').'</td><td>';
310  if ($parent_rowid) {
311  print $langs->trans('Left');
312  print '<input type="hidden" name="type" value="left">';
313  } else {
314  print '<select name="type" class="flat" id="topleft">';
315  print '<option value="">&nbsp;</option>';
316  print '<option value="top"'.(GETPOST("type") == 'top' ? ' selected' : '').'>'.$langs->trans('Top').'</option>';
317  print '<option value="left"'.(GETPOST("type") == 'left' ? ' selected' : '').'>'.$langs->trans('Left').'</option>';
318  print '</select>';
319  print ajax_combobox('topleft');
320  }
321  print '</td><td>'.$langs->trans('DetailType').'</td></tr>';
322 
323  // Mainmenu code
324  print '<tr><td class="fieldrequired">'.$langs->trans('MainMenuCode').'</td>';
325  print '<td><input type="text" class="minwidth300" id="propertymainmenu" name="propertymainmenu" value="'.(GETPOSTISSET("propertymainmenu") ? GETPOST("propertymainmenu", 'alphanohtml') : '').'"></td>';
326  print '<td>';
327  print $langs->trans("Example").': mytopmenukey';
328  print '</td></tr>';
329 
330  // MenuId Parent
331  print '<tr><td class="fieldrequired">'.$langs->trans('MenuIdParent').'</td>';
332  if ($parent_rowid) {
333  print '<td>'.$parent_rowid.'<input type="hidden" name="menuId" value="'.$parent_rowid.'"></td>';
334  } else {
335  print '<td><input type="text" class="minwidth300" id="menuId" name="menuId" value="'.(GETPOSTISSET("menuId") ? GETPOST("menuId", 'int') : '').'"></td>';
336  }
337  print '<td>'.$langs->trans('DetailMenuIdParent');
338  print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
339  print '</td></tr>';
340 
341  // Title
342  print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td>';
343  print '<td><input type="text" class="minwidth300" name="titre" value="'.dol_escape_htmltag(GETPOST("titre", 'alphanohtml')).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
344 
345  // URL
346  print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td>';
347  print '<td><input type="text" class="minwidth500" name="url" value="'.GETPOST("url", 'alphanohtml').'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
348 
349  // Langs
350  print '<tr><td>'.$langs->trans('LangFile').'</td>';
351  print '<td><input type="text" class="minwidth300" name="langs" value="'.$parent_langs.'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
352 
353  // Position
354  print '<tr><td>'.$langs->trans('Position').'</td>';
355  print '<td><input type="text" class="width100" name="position" value="'.dol_escape_htmltag(GETPOSTISSET("position") ? GETPOST("position", 'int') : 100).'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
356 
357  // Enabled
358  print '<tr><td>'.$langs->trans('Enabled').'</td>';
359  print '<td><input type="text" class="minwidth500" name="enabled" value="'.(GETPOSTISSET('enabled') ? GETPOST("enabled", 'alphanohtml') : '1').'"></td><td>'.$langs->trans('DetailEnabled').'</td></tr>';
360 
361  // Perms
362  print '<tr><td>'.$langs->trans('Rights').'</td>';
363  print '<td><input type="text" class="minwidth500" name="perms" value="'.(GETPOSTISSET('perms') ? GETPOST('perms', 'alphanohtml') : '1').'"></td><td>'.$langs->trans('DetailRight').'</td></tr>';
364 
365  // Target
366  print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target" id="target">';
367  print '<option value=""'.(isset($menu->target) && $menu->target == "" ? ' selected' : '').'>&nbsp;</option>';
368  print '<option value="_blank"'.(isset($menu->target) && $menu->target == "_blank" ? ' selected' : '').'>'.$langs->trans('_blank').'</option>';
369  print '</select>';
370  print ajax_combobox("target");
371  print '</td></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
372 
373  print '</table>';
374 
375  print dol_get_fiche_end();
376 
377  print $form->buttonsSaveCancel();
378 
379  print '</form>';
380 } elseif ($action == 'edit') {
381  print load_fiche_titre($langs->trans("ModifMenu"), '', 'title_setup');
382  print '<br>';
383 
384  print '<form action="./edit.php?action=update" method="POST" name="formmenuedit">';
385  print '<input type="hidden" name="token" value="'.newToken().'">';
386  print '<input type="hidden" name="handler_origine" value="'.$menu_handler.'">';
387  print '<input type="hidden" name="menuId" value="'.GETPOST('menuId', 'int').'">';
388 
389  print dol_get_fiche_head();
390 
391  print '<table class="border centpercent">';
392 
393  $menu = new Menubase($db);
394  $result = $menu->fetch(GETPOST('menuId', 'int'));
395  //var_dump($menu);
396 
397  // Id
398  print '<tr><td>'.$langs->trans('Id').'</td><td>'.$menu->id.'</td><td>'.$langs->trans('DetailId').'</td></tr>';
399 
400  // Module
401  print '<tr><td>'.$langs->trans('MenuModule').'</td><td>'.(empty($menu->module) ? 'Core' : $menu->module).'</td><td><span class="opacitymedium">'.$langs->trans('DetailMenuModule').'</span></td></tr>';
402 
403  // Handler
404  if ($menu->menu_handler == 'all') {
405  $handler = $langs->trans('AllMenus');
406  } else {
407  $handler = $menu->menu_handler;
408  }
409  print '<tr><td class="fieldrequired">'.$langs->trans('MenuHandler').'</td><td>'.$handler.'</td><td>'.$langs->trans('DetailMenuHandler').'</td></tr>';
410 
411  // User
412  print '<tr><td class="nowrap fieldrequired">'.$langs->trans('MenuForUsers').'</td><td>';
413  print '<select class="flat" name="user" id="menuuser">';
414  print '<option value="2"'.($menu->user == 2 ? ' selected' : '').'>'.$langs->trans("AllMenus").'</option>';
415  print '<option value="0"'.($menu->user == 0 ? ' selected' : '').'>'.$langs->trans('Internal').'</option>';
416  print '<option value="1"'.($menu->user == 1 ? ' selected' : '').'>'.$langs->trans('External').'</option>';
417  print '</select>';
418  print ajax_combobox('menuuser');
419  print '</td><td>'.$langs->trans('DetailUser').'</td></tr>';
420 
421  // Type
422  print '<tr><td class="fieldrequired">'.$langs->trans('Position').'</td>';
423  print '<td>'.$langs->trans(ucfirst($menu->type)).'</td><td>'.$langs->trans('DetailType').'</td></tr>';
424 
425  // Mainmenu code
426  if ($menu->type == 'top') {
427  print '<tr><td class="fieldrequired">'.$langs->trans('MainMenuCode').'</td>';
428  /*if ($parent_rowid)
429  {
430  print '<td>'.$parent_rowid.'<input type="hidden" name="propertyleftmenu" value="'.$parent_rowid.'"></td>';
431  }
432  else
433  {*/
434  print '<td><input type="text" class="minwidth300" id="propertymainmenu" name="propertymainmenu" value="'.(GETPOST("propertymainmenu", 'alphanohtml') ?GETPOST("propertymainmenu", 'alphanohtml') : $menu->mainmenu).'"></td>';
435  //}
436  print '<td>';
437  print $langs->trans("Example").': mytopmenukey';
438  print '</td></tr>';
439  }
440 
441  // MenuId Parent
442  print '<tr><td class="fieldrequired">'.$langs->trans('MenuIdParent');
443  print '</td>';
444  $valtouse = $menu->fk_menu;
445  if ($menu->fk_mainmenu) {
446  $valtouse = 'fk_mainmenu='.$menu->fk_mainmenu;
447  }
448  if ($menu->fk_leftmenu) {
449  $valtouse .= '&fk_leftmenu='.$menu->fk_leftmenu;
450  }
451  print '<td><input type="text" name="menuIdParent" value="'.$valtouse.'" class="minwidth300"></td>';
452  print '<td>'.$langs->trans('DetailMenuIdParent');
453  print ', <span class="opacitymedium">'.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def</span>';
454  print '</td></tr>';
455 
456  // Niveau
457  //print '<tr><td>'.$langs->trans('Level').'</td><td>'.$menu->level.'</td><td>'.$langs->trans('DetailLevel').'</td></tr>';
458 
459  // Title
460  print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td>';
461  print '<td><input type="text" class="minwidth300" name="titre" value="'.dol_escape_htmltag($menu->title).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
462 
463  // Url
464  print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td>';
465  print '<td><input type="text" class="quatrevingtpercent" name="url" value="'.$menu->url.'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
466 
467  // Langs
468  print '<tr><td>'.$langs->trans('LangFile').'</td>';
469  print '<td><input type="text" class="minwidth300" name="langs" value="'.dol_escape_htmltag($menu->langs).'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
470 
471  // Position
472  print '<tr><td>'.$langs->trans('Position').'</td>';
473  print '<td><input type="text" class="minwidth100" name="position" value="'.$menu->position.'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
474 
475  // Enabled
476  print '<tr><td>'.$langs->trans('Enabled').'</td>';
477  print '<td><input type="text" class="minwidth500" name="enabled" value="'.dol_escape_htmltag($menu->enabled).'"></td><td>'.$langs->trans('DetailEnabled');
478  if (!empty($menu->enabled)) {
479  print ' <span class="opacitymedium">('.$langs->trans("ConditionIsCurrently").':</span> '.yn(dol_eval($menu->enabled, 1, 1, '1')).')';
480  }
481  print '</td></tr>';
482 
483  // Perms
484  print '<tr><td>'.$langs->trans('Rights').'</td>';
485  print '<td><input type="text" class="minwidth500" name="perms" value="'.dol_escape_htmltag($menu->perms).'"></td><td>'.$langs->trans('DetailRight');
486  if (!empty($menu->perms)) {
487  print ' <span class="opacitymedium">('.$langs->trans("ConditionIsCurrently").':</span> '.yn(dol_eval($menu->perms, 1, 1, '1')).')';
488  }
489  print '</td></tr>';
490 
491  // Target
492  print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" id="target" name="target">';
493  print '<option value=""'.($menu->target == "" ? ' selected' : '').'>&nbsp;</option>';
494  print '<option value="_blank"'.($menu->target == "_blank" ? ' selected' : '').'>'.$langs->trans('_blank').'</option>';
495  print '</select>';
496  print ajax_combobox("target");
497  print '</td><td>'.$langs->trans('DetailTarget').'</td></tr>';
498 
499  print '</table>';
500 
501  print dol_get_fiche_end();
502 
503  print $form->buttonsSaveCancel();
504 
505  print '</form>';
506 
507  print '<br>';
508 }
509 
510 // End of page
511 llxFooter();
512 $db->close();
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
Definition: ajax.lib.php:449
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
llxFooter()
Empty footer.
Definition: wrapper.php:70
Class to generate html code for admin pages.
Class to manage generation of HTML components Only common components must be here.
Class to manage menu entries.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.