dolibarr  17.0.4
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 if ($action == 'setenableautolettering') {
265  $setenableautolettering = GETPOST('value', 'int');
266  $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_AUTOLETTERING", $setenableautolettering, 'yesno', 0, '', $conf->entity);
267  if (!($res > 0)) {
268  $error++;
269  }
270 
271  if (!$error) {
272  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
273  } else {
274  setEventMessages($langs->trans("Error"), null, 'mesgs');
275  }
276 }
277 
278 
279 /*
280  * View
281  */
282 
283 $form = new Form($db);
284 
285 $title = $langs->trans('ConfigAccountingExpert');
286 llxHeader('', $title);
287 
288 $linkback = '';
289 //$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
290 print load_fiche_titre($title, $linkback, 'accountancy');
291 
292 // Show message if accountancy hidden options are activated to help to resolve some problems
293 if (!$user->admin) {
294  if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
295  print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
296  }
297  if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
298  print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
299  }
300  if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
301  print '<div class="info">' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '</div>';
302  }
303  if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
304  print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '</div>';
305  }
306  if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
307  print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '</div>';
308  }
309 }
310 
311 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
312 print '<input type="hidden" name="token" value="'.newToken().'">';
313 print '<input type="hidden" name="action" value="update">';
314 
315 // Params
316 print '<table class="noborder centpercent">';
317 print '<tr class="liste_titre">';
318 print '<td colspan="2">'.$langs->trans('Options').'</td>';
319 print "</tr>\n";
320 
321 // TO DO Mutualize code for yes/no constants
322 
323 /* Set this option as a hidden option but keep it for some needs.
324 print '<tr>';
325 print '<td>'.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").'</td>';
326 if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
327  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&enabledraftexport&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().'&enabledraftexport&value=1">';
332  print img_picto($langs->trans("Disabled"), 'switch_off');
333  print '</a></td>';
334 }
335 print '</tr>';
336 */
337 
338 print '<tr class="oddeven">';
339 print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';
340 if (!empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
341  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
342  print img_picto($langs->trans("Activated"), 'switch_on');
343  print '</a></td>';
344 } else {
345  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
346  print img_picto($langs->trans("Disabled"), 'switch_off');
347  print '</a></td>';
348 }
349 print '</tr>';
350 
351 print '<tr class="oddeven">';
352 print '<td>'.$langs->trans("ACCOUNTANCY_COMBO_FOR_AUX");
353 print ' - <span class="opacitymedium">'.$langs->trans("NotRecommended").'</span>';
354 print '</td>';
355 
356 if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
357  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=0">';
358  print img_picto($langs->trans("Activated"), 'switch_on');
359  print '</a></td>';
360 } else {
361  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=1">';
362  print img_picto($langs->trans("Disabled"), 'switch_off');
363  print '</a></td>';
364 }
365 print '</tr>';
366 
367 print '<tr class="oddeven">';
368 print '<td>'.$langs->trans("ACCOUNTING_MANAGE_ZERO").'</td>';
369 if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
370  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_MANAGE_ZERO&value=0">';
371  print img_picto($langs->trans("Activated"), 'switch_on');
372  print '</a></td>';
373 } else {
374  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_MANAGE_ZERO&value=1">';
375  print img_picto($langs->trans("Disabled"), 'switch_off');
376  print '</a></td>';
377 }
378 print '</tr>';
379 
380 // Param a user $user->rights->accounting->chartofaccount can access
381 foreach ($list as $key) {
382  print '<tr class="oddeven value">';
383 
384  if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) {
385  continue;
386  }
387 
388  // Param
389  $label = $langs->trans($key);
390  print '<td>'.$label.'</td>';
391  // Value
392  print '<td class="right">';
393  print '<input type="text" class="maxwidth50 right" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
394 
395  print '</td>';
396  print '</tr>';
397 }
398 print '</table>';
399 print '<br>';
400 
401 // Binding params
402 print '<table class="noborder centpercent">';
403 print '<tr class="liste_titre">';
404 print '<td colspan="2">'.$langs->trans('BindingOptions').'</td>';
405 print "</tr>\n";
406 
407 // TO DO Mutualize code for yes/no constants
408 print '<tr class="oddeven">';
409 print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO").'</td>';
410 if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
411  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_TODO&value=0">';
412  print img_picto($langs->trans("Activated"), 'switch_on');
413  print '</a></td>';
414 } else {
415  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_TODO&value=1">';
416  print img_picto($langs->trans("Disabled"), 'switch_off');
417  print '</a></td>';
418 }
419 print '</tr>';
420 
421 print '<tr class="oddeven">';
422 print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE").'</td>';
423 if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
424  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_DONE&value=0">';
425  print img_picto($langs->trans("Activated"), 'switch_on');
426  print '</a></td>';
427 } else {
428  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_DONE&value=1">';
429  print img_picto($langs->trans("Disabled"), 'switch_off');
430  print '</a></td>';
431 }
432 print '</tr>';
433 
434 // Param a user $user->rights->accounting->chartofaccount can access
435 foreach ($list_binding as $key) {
436  print '<tr class="oddeven value">';
437 
438  // Param
439  $label = $langs->trans($key);
440  print '<td>'.$label.'</td>';
441  // Value
442  print '<td class="right">';
443  if ($key == 'ACCOUNTING_DATE_START_BINDING') {
444  print $form->selectDate((!empty($conf->global->$key) ? $db->idate($conf->global->$key) : -1), $key, 0, 0, 1);
445  } elseif ($key == 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') {
446  $array = array(0=>$langs->trans("PreviousMonth"), 1=>$langs->trans("CurrentMonth"), 2=>$langs->trans("Fiscalyear"));
447  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');
448  } else {
449  print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
450  }
451 
452  print '</td>';
453  print '</tr>';
454 }
455 
456 print '<tr class="oddeven">';
457 print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_SALES").'</td>';
458 if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
459  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonsales&value=0">';
460  print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
461  print '</a></td>';
462 } else {
463  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonsales&value=1">';
464  print img_picto($langs->trans("Disabled"), 'switch_off');
465  print '</a></td>';
466 }
467 print '</tr>';
468 
469 print '<tr class="oddeven">';
470 print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").'</td>';
471 if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
472  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonpurchases&value=0">';
473  print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
474  print '</a></td>';
475 } else {
476  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonpurchases&value=1">';
477  print img_picto($langs->trans("Disabled"), 'switch_off');
478  print '</a></td>';
479 }
480 print '</tr>';
481 
482 print '<tr class="oddeven">';
483 print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").'</td>';
484 if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
485  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonexpensereports&value=0">';
486  print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
487  print '</a></td>';
488 } else {
489  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonexpensereports&value=1">';
490  print img_picto($langs->trans("Disabled"), 'switch_off');
491  print '</a></td>';
492 }
493 print '</tr>';
494 
495 print '</table>';
496 print '<br>';
497 
498 // Lettering params
499 print '<table class="noborder centpercent">';
500 print '<tr class="liste_titre">';
501 print '<td colspan="2">'.$langs->trans('Options').' '.$langs->trans('Lettering').'</td>';
502 print "</tr>\n";
503 
504 print '<tr class="oddeven">';
505 print '<td>'.$langs->trans("ACCOUNTING_ENABLE_LETTERING").'</td>';
506 if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
507  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablelettering&value=0">';
508  print img_picto($langs->trans("Activated"), 'switch_on');
509  print '</a></td>';
510 } else {
511  print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablelettering&value=1">';
512  print img_picto($langs->trans("Disabled"), 'switch_off');
513  print '</a></td>';
514 }
515 print '</tr>';
516 
517 if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
518  print '<tr class="oddeven">';
519  print '<td>' . $langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING") . '</td>';
520  if (!empty($conf->global->ACCOUNTING_ENABLE_AUTOLETTERING)) {
521  print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=0">';
522  print img_picto($langs->trans("Activated"), 'switch_on');
523  print '</a></td>';
524  } else {
525  print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=1">';
526  print img_picto($langs->trans("Disabled"), 'switch_off');
527  print '</a></td>';
528  }
529  print '</tr>';
530 }
531 
532 print '</table>';
533 
534 print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Modify').'"></div>';
535 
536 print '</form>';
537 
538 // End of page
539 llxFooter();
540 $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.