export.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
  5. * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
  6. * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
  7. * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
  8. * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
  9. * Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 3 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  23. */
  24. /**
  25. * \file htdocs/admin/export.php
  26. * \ingroup export
  27. * \brief config Page module Export
  28. */
  29. // Load Dolibarr environment
  30. require '../main.inc.php';
  31. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  32. // Load translation files required by the page
  33. $langs->loadLangs(array('admin', 'exports', 'other'));
  34. if (!$user->admin) {
  35. accessforbidden();
  36. }
  37. $action = GETPOST('action', 'aZ09');
  38. /*
  39. * Actions
  40. */
  41. if ($action == 'save') {
  42. dolibarr_set_const($db, 'EXPORT_CSV_SEPARATOR_TO_USE', GETPOST('EXPORT_CSV_SEPARATOR_TO_USE', 'alphanohtml'), 'chaine', 0, '', $conf->entity);
  43. }
  44. /*
  45. * View
  46. */
  47. $form = new Form($db);
  48. $page_name = "ExportSetup";
  49. llxHeader('', $langs->trans($page_name));
  50. // Subheader
  51. $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
  52. print load_fiche_titre($langs->trans($page_name), $linkback);
  53. //$head = export_admin_prepare_head();
  54. $h = 0;
  55. $head = array();
  56. $head[$h][0] = DOL_URL_ROOT.'/admin/export.php';
  57. $head[$h][1] = $langs->trans("Setup");
  58. $head[$h][2] = 'setup';
  59. $h++;
  60. print dol_get_fiche_head($head, 'setup', $langs->trans("ExportsArea"), -1, "technic");
  61. print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
  62. print '<input type="hidden" name="token" value="'.newToken().'">';
  63. print '<input type="hidden" name="action" value="save">';
  64. print '<table class="noborder centpercent">';
  65. print '<tr class="liste_titre">';
  66. print '<td>'.$langs->trans("Parameters").'</td>'."\n";
  67. print '<td class="center" width="20">&nbsp;</td>';
  68. print '<td class="center" width="100"></td>'."\n";
  69. print '</tr>';
  70. /* No more need for this, you can set that a profile is public when saving it.
  71. print '<tr class="oddeven">';
  72. print '<td>'.$langs->trans("EXPORTS_SHARE_MODELS").'</td>';
  73. print '<td class="center" width="20">&nbsp;</td>';
  74. print '<td class="center" width="100">';
  75. print ajax_constantonoff('EXPORTS_SHARE_MODELS');
  76. print '</td></tr>';
  77. */
  78. print '<tr class="oddeven">';
  79. print '<td>'.$langs->trans("ExportCsvSeparator").'</td>';
  80. print '<td width="60" align="center"><input class="flat width50" maxlength="3" type="text" name="EXPORT_CSV_SEPARATOR_TO_USE" value="'.(!getDolGlobalString('EXPORT_CSV_SEPARATOR_TO_USE') ? ',' : $conf->global->EXPORT_CSV_SEPARATOR_TO_USE).'"></td>';
  81. print '<td class="right"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
  82. print '</tr>';
  83. print '</table>';
  84. print '</form>';
  85. print dol_get_fiche_end();
  86. // End of page
  87. llxFooter();
  88. $db->close();