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