dolibarr  x.y.z
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
3  * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
4  * Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
5  * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
6  * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
7  * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
8  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
9  * Copyright (C) 2017 Laurent Destailleur <eldy@destailleur.fr>
10  * Copyright (C) 2021 Ferran Marcet <fmarcet@2byte.es>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <https://www.gnu.org/licenses/>.
24  */
25 
32 // Load Dolibarr environment
33 require '../../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
36 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
37 
38 // Load translation files required by the page
39 $langs->loadLangs(array("compta", "bills", "admin", "accountancy", "other"));
40 
41 // Security access
42 if (!$user->hasRight('accounting', 'chartofaccount')) {
44 }
45 
46 $action = GETPOST('action', 'aZ09');
47 
48 // Parameters ACCOUNTING_* and others
49 $list = array(
50  'ACCOUNTING_LENGTH_GACCOUNT',
51  'ACCOUNTING_LENGTH_AACCOUNT',
52 // 'ACCOUNTING_LIMIT_LIST_VENTILATION' // there is already a global parameter to define the nb of records in lists, we must use it in priority. Having one parameter for nb of record for each page is deprecated.
53 // 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc
54 // 'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc
55 );
56 
57 $list_binding = array(
58  'ACCOUNTING_DATE_START_BINDING',
59  'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER'
60 );
61 
62 $error = 0;
63 
64 
65 /*
66  * Actions
67  */
68 
69 if (in_array($action, array(
70  'setBANK_DISABLE_DIRECT_INPUT',
71  'setACCOUNTANCY_COMBO_FOR_AUX',
72  'setACCOUNTING_MANAGE_ZERO',
73  'setACCOUNTING_LIST_SORT_VENTILATION_TODO',
74  'setACCOUNTING_LIST_SORT_VENTILATION_DONE'))) {
75  $constname = preg_replace('/^set/', '', $action);
76  $constvalue = GETPOST('value', 'int');
77  $res = dolibarr_set_const($db, $constname, $constvalue, 'yesno', 0, '', $conf->entity);
78  if (!($res > 0)) {
79  $error++;
80  }
81 
82  if (!$error) {
83  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
84  } else {
85  setEventMessages($langs->trans("Error"), null, 'mesgs');
86  }
87 }
88 
89 if ($action == 'update') {
90  $error = 0;
91 
92  if (!$error) {
93  foreach ($list as $constname) {
94  $constvalue = GETPOST($constname, 'alpha');
95  if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
96  $error++;
97  }
98  }
99  if ($error) {
100  setEventMessages($langs->trans("Error"), null, 'errors');
101  }
102 
103  foreach ($list_binding as $constname) {
104  $constvalue = GETPOST($constname, 'alpha');
105 
106  if ($constname == 'ACCOUNTING_DATE_START_BINDING') {
107  $constvalue = dol_mktime(0, 0, 0, GETPOST($constname.'month', 'int'), GETPOST($constname.'day', 'int'), GETPOST($constname.'year', 'int'));
108  }
109 
110  if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
111  $error++;
112  }
113  }
114  if ($error) {
115  setEventMessages($langs->trans("Error"), null, 'errors');
116  }
117  }
118 
119  if (!$error) {
120  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
121  }
122 }
123 
124 if ($action == 'setlistsorttodo') {
125  $setlistsorttodo = GETPOST('value', 'int');
126  $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity);
127  if (!($res > 0)) {
128  $error++;
129  }
130 
131  if (!$error) {
132  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
133  } else {
134  setEventMessages($langs->trans("Error"), null, 'mesgs');
135  }
136 }
137 
138 if ($action == 'setlistsortdone') {
139  $setlistsortdone = GETPOST('value', 'int');
140  $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone, 'yesno', 0, '', $conf->entity);
141  if (!($res > 0)) {
142  $error++;
143  }
144 
145  if (!$error) {
146  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
147  } else {
148  setEventMessages($langs->trans("Error"), null, 'mesgs');
149  }
150 }
151 
152 if ($action == 'setmanagezero') {
153  $setmanagezero = GETPOST('value', 'int');
154  $res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity);
155  if (!($res > 0)) {
156  $error++;
157  }
158 
159  if (!$error) {
160  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
161  } else {
162  setEventMessages($langs->trans("Error"), null, 'mesgs');
163  }
164 }
165 
166 if ($action == 'setdisabledirectinput') {
167  $setdisabledirectinput = GETPOST('value', 'int');
168  $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
169  if (!($res > 0)) {
170  $error++;
171  }
172 
173  if (!$error) {
174  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
175  } else {
176  setEventMessages($langs->trans("Error"), null, 'mesgs');
177  }
178 }
179 
180 if ($action == 'setenabledraftexport') {
181  $setenabledraftexport = GETPOST('value', 'int');
182  $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity);
183  if (!($res > 0)) {
184  $error++;
185  }
186 
187  if (!$error) {
188  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
189  } else {
190  setEventMessages($langs->trans("Error"), null, 'mesgs');
191  }
192 }
193 
194 if ($action == 'setenablesubsidiarylist') {
195  $setenablesubsidiarylist = GETPOST('value', 'int');
196  $res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity);
197  if (!($res > 0)) {
198  $error++;
199  }
200 
201  if (!$error) {
202  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
203  } else {
204  setEventMessages($langs->trans("Error"), null, 'mesgs');
205  }
206 }
207 
208 if ($action == 'setdisablebindingonsales') {
209  $setdisablebindingonsales = GETPOST('value', 'int');
210  $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales, 'yesno', 0, '', $conf->entity);
211  if (!($res > 0)) {
212  $error++;
213  }
214 
215  if (!$error) {
216  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
217  } else {
218  setEventMessages($langs->trans("Error"), null, 'mesgs');
219  }
220 }
221 
222 if ($action == 'setdisablebindingonpurchases') {
223  $setdisablebindingonpurchases = GETPOST('value', 'int');
224  $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases, 'yesno', 0, '', $conf->entity);
225  if (!($res > 0)) {
226  $error++;
227  }
228 
229  if (!$error) {
230  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
231  } else {
232  setEventMessages($langs->trans("Error"), null, 'mesgs');
233  }
234 }
235 
236 if ($action == 'setdisablebindingonexpensereports') {
237  $setdisablebindingonexpensereports = GETPOST('value', 'int');
238  $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports, 'yesno', 0, '', $conf->entity);
239  if (!($res > 0)) {
240  $error++;
241  }
242 
243  if (!$error) {
244  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
245  } else {
246  setEventMessages($langs->trans("Error"), null, 'mesgs');
247  }
248 }
249 
250 if ($action == 'setenablelettering') {
251  $setenablelettering = GETPOST('value', 'int');
252  $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_LETTERING", $setenablelettering, 'yesno', 0, '', $conf->entity);
253  if (!($res > 0)) {
254  $error++;
255  }
256 
257  if (!$error) {
258  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
259  } else {
260  setEventMessages($langs->trans("Error"), null, 'mesgs');
261  }
262 }
263 
264 
265 /*
266  * View
267  */
268 
269 $form = new Form($db);
270 
271 $title = $langs->trans('ConfigAccountingExpert');
272 llxHeader('', $title);
273 
274 $linkback = '';
275 //$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
276 print load_fiche_titre($title, $linkback, 'accountancy');
277 
278 // Show message if accountancy hidden options are activated to help to resolve some problems
279 if (!$user->admin) {
280  if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
281  print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
282  }
283  if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
284  print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
285  }
286  if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
287  print '<div class="info">' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '</div>';
288  }
289  if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
290  print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '</div>';
291  }
292  if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
293  print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '</div>';
294  }
295 }
296 
297 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
298 print '<input type="hidden" name="token" value="'.newToken().'">';
299 print '<input type="hidden" name="action" value="update">';
300 
301 // Params
302 print '<table class="noborder centpercent">';
303 print '<tr class="liste_titre">';
304 print '<td colspan="2">'.$langs->trans('Options').'</td>';
305 print "</tr>\n";
306 
307 // TO DO Mutualize code for yes/no constants
308 
309 /* Set this option as a hidden option but keep it for some needs.
310 print '<tr>';
311 print '<td>'.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").'</td>';
312 if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
313  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&enabledraftexport&value=0">';
314  print img_picto($langs->trans("Activated"), 'switch_on');
315  print '</a></td>';
316 } else {
317  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&enabledraftexport&value=1">';
318  print img_picto($langs->trans("Disabled"), 'switch_off');
319  print '</a></td>';
320 }
321 print '</tr>';
322 */
323 
324 print '<tr class="oddeven">';
325 print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';
326 if (!empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
327  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
328  print img_picto($langs->trans("Activated"), 'switch_on');
329  print '</a></td>';
330 } else {
331  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
332  print img_picto($langs->trans("Disabled"), 'switch_off');
333  print '</a></td>';
334 }
335 print '</tr>';
336 
337 print '<tr class="oddeven">';
338 print '<td>'.$langs->trans("ACCOUNTANCY_COMBO_FOR_AUX");
339 print ' - <span class="opacitymedium">'.$langs->trans("NotRecommended").'</span>';
340 print '</td>';
341 
342 if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
343  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=0">';
344  print img_picto($langs->trans("Activated"), 'switch_on');
345  print '</a></td>';
346 } else {
347  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=1">';
348  print img_picto($langs->trans("Disabled"), 'switch_off');
349  print '</a></td>';
350 }
351 print '</tr>';
352 
353 print '<tr class="oddeven">';
354 print '<td>'.$langs->trans("ACCOUNTING_MANAGE_ZERO").'</td>';
355 if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
356  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_MANAGE_ZERO&value=0">';
357  print img_picto($langs->trans("Activated"), 'switch_on');
358  print '</a></td>';
359 } else {
360  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_MANAGE_ZERO&value=1">';
361  print img_picto($langs->trans("Disabled"), 'switch_off');
362  print '</a></td>';
363 }
364 print '</tr>';
365 
366 // Param a user $user->rights->accounting->chartofaccount can access
367 foreach ($list as $key) {
368  print '<tr class="oddeven value">';
369 
370  if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) {
371  continue;
372  }
373 
374  // Param
375  $label = $langs->trans($key);
376  print '<td>'.$label.'</td>';
377  // Value
378  print '<td class="right">';
379  print '<input type="text" class="maxwidth50 right" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
380 
381  print '</td>';
382  print '</tr>';
383 }
384 print '</table>';
385 print '<br>';
386 
387 // Binding params
388 print '<table class="noborder centpercent">';
389 print '<tr class="liste_titre">';
390 print '<td colspan="2">'.$langs->trans('BindingOptions').'</td>';
391 print "</tr>\n";
392 
393 // TO DO Mutualize code for yes/no constants
394 print '<tr class="oddeven">';
395 print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO").'</td>';
396 if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
397  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_TODO&value=0">';
398  print img_picto($langs->trans("Activated"), 'switch_on');
399  print '</a></td>';
400 } else {
401  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_TODO&value=1">';
402  print img_picto($langs->trans("Disabled"), 'switch_off');
403  print '</a></td>';
404 }
405 print '</tr>';
406 
407 print '<tr class="oddeven">';
408 print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE").'</td>';
409 if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
410  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_DONE&value=0">';
411  print img_picto($langs->trans("Activated"), 'switch_on');
412  print '</a></td>';
413 } else {
414  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_DONE&value=1">';
415  print img_picto($langs->trans("Disabled"), 'switch_off');
416  print '</a></td>';
417 }
418 print '</tr>';
419 
420 // Param a user $user->rights->accounting->chartofaccount can access
421 foreach ($list_binding as $key) {
422  print '<tr class="oddeven value">';
423 
424  // Param
425  $label = $langs->trans($key);
426  print '<td>'.$label.'</td>';
427  // Value
428  print '<td class="right">';
429  if ($key == 'ACCOUNTING_DATE_START_BINDING') {
430  print $form->selectDate((!empty($conf->global->$key) ? $db->idate($conf->global->$key) : -1), $key, 0, 0, 1);
431  } elseif ($key == 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') {
432  $array = array(0=>$langs->trans("PreviousMonth"), 1=>$langs->trans("CurrentMonth"), 2=>$langs->trans("Fiscalyear"));
433  print $form->selectarray($key, $array, (isset($conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER) ? $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER : 0), 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage');
434  } else {
435  print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
436  }
437 
438  print '</td>';
439  print '</tr>';
440 }
441 
442 print '<tr class="oddeven">';
443 print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_SALES").'</td>';
444 if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
445  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonsales&value=0">';
446  print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
447  print '</a></td>';
448 } else {
449  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonsales&value=1">';
450  print img_picto($langs->trans("Disabled"), 'switch_off');
451  print '</a></td>';
452 }
453 print '</tr>';
454 
455 print '<tr class="oddeven">';
456 print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").'</td>';
457 if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
458  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonpurchases&value=0">';
459  print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
460  print '</a></td>';
461 } else {
462  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonpurchases&value=1">';
463  print img_picto($langs->trans("Disabled"), 'switch_off');
464  print '</a></td>';
465 }
466 print '</tr>';
467 
468 print '<tr class="oddeven">';
469 print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").'</td>';
470 if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
471  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonexpensereports&value=0">';
472  print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
473  print '</a></td>';
474 } else {
475  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonexpensereports&value=1">';
476  print img_picto($langs->trans("Disabled"), 'switch_off');
477  print '</a></td>';
478 }
479 print '</tr>';
480 
481 print '</table>';
482 
483 // Lettering params
484 print '<table class="noborder centpercent">';
485 print '<tr class="liste_titre">';
486 print '<td colspan="2">'.$langs->trans('Options').' '.$langs->trans('Lettering').'</td>';
487 print "</tr>\n";
488 
489 print '<tr class="oddeven">';
490 print '<td>'.$langs->trans("ACCOUNTING_ENABLE_LETTERING").'</td>';
491 if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
492  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablelettering&value=0">';
493  print img_picto($langs->trans("Activated"), 'switch_on');
494  print '</a></td>';
495 } else {
496  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablelettering&value=1">';
497  print img_picto($langs->trans("Disabled"), 'switch_off');
498  print '</a></td>';
499 }
500 print '</tr>';
501 
502 print '</table>';
503 
504 print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Modify').'"></div>';
505 
506 print '</form>';
507 
508 // End of page
509 llxFooter();
510 $db->close();
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:632
Class to manage generation of HTML components Only common components must be here.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
llxFooter()
Footer empty.
Definition: index.php:71
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
Definition: index.php:63
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.