dolibarr/htdocs/admin/export.php

123 lines
3.9 KiB
PHP
Raw Permalink Normal View History

2018-01-18 12:34:22 +01:00
<?php
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
2018-10-27 14:43:12 +02:00
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
2018-01-18 12:34:22 +01:00
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
2018-07-28 17:26:56 +02:00
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
add baseline exclude for phpstan (#31632) * add baseline exclude for phpstan * update * update * update * update * update * merge * restore one filter * delete old errors * fix * fix * fix * $moreforfilter can t be empty * fix * enable check * refresh baseline * add phpdoc * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-04 23:53:20 +01:00
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
2018-01-18 12:34:22 +01:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2018-01-18 12:34:22 +01:00
*/
/**
* \file htdocs/admin/export.php
* \ingroup export
* \brief config Page module Export
2018-01-18 12:34:22 +01:00
*/
2022-09-07 20:08:59 +02:00
// Load Dolibarr environment
2018-01-18 12:34:22 +01:00
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
add baseline exclude for phpstan (#31632) * add baseline exclude for phpstan * update * update * update * update * update * merge * restore one filter * delete old errors * fix * fix * fix * $moreforfilter can t be empty * fix * enable check * refresh baseline * add phpdoc * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-04 23:53:20 +01:00
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
*/
2018-05-26 18:41:16 +02:00
// Load translation files required by the page
2018-07-28 17:26:56 +02:00
$langs->loadLangs(array('admin', 'exports', 'other'));
2018-01-18 12:34:22 +01:00
2021-02-26 22:04:03 +01:00
if (!$user->admin) {
2018-01-18 12:34:22 +01:00
accessforbidden();
2021-02-26 22:04:03 +01:00
}
2018-01-18 12:34:22 +01:00
2020-09-16 19:39:50 +02:00
$action = GETPOST('action', 'aZ09');
2020-03-18 19:21:32 +01:00
2018-01-18 12:34:22 +01:00
/*
* Actions
*/
2020-03-18 19:21:32 +01:00
if ($action == 'save') {
dolibarr_set_const($db, 'EXPORT_CSV_SEPARATOR_TO_USE', GETPOST('EXPORT_CSV_SEPARATOR_TO_USE', 'alphanohtml'), 'chaine', 0, '', $conf->entity);
2020-03-18 19:21:32 +01:00
}
2018-01-18 12:34:22 +01:00
/*
* View
*/
$form = new Form($db);
2019-03-26 12:18:28 +01:00
2018-01-18 12:34:22 +01:00
$page_name = "ExportSetup";
llxHeader('', $langs->trans($page_name), '', '', 0, 0, '', '', '', 'mod-admin page-export');
2018-01-18 12:34:22 +01:00
// Subheader
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
2019-03-26 12:18:28 +01:00
print load_fiche_titre($langs->trans($page_name), $linkback);
2018-01-18 12:34:22 +01:00
2019-03-26 12:18:28 +01:00
//$head = export_admin_prepare_head();
$h = 0;
2019-03-26 12:18:28 +01:00
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/admin/export.php';
$head[$h][1] = $langs->trans("Setup");
$head[$h][2] = 'setup';
$h++;
2018-01-18 12:34:22 +01:00
2020-10-22 22:50:03 +02:00
print dol_get_fiche_head($head, 'setup', $langs->trans("ExportsArea"), -1, "technic");
2018-01-18 12:34:22 +01:00
2020-03-18 19:07:15 +01:00
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
2020-03-18 19:21:32 +01:00
print '<input type="hidden" name="action" value="save">';
2018-07-28 17:26:56 +02:00
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">';
2018-01-18 12:34:22 +01:00
print '<tr class="liste_titre">';
2019-03-26 12:18:28 +01:00
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
2019-03-20 09:53:29 +01:00
print '<td class="center" width="20">&nbsp;</td>';
print '<td class="center" width="100"></td>'."\n";
print '</tr>';
2018-01-18 12:34:22 +01:00
/* No more need for this, you can set that a profile is public when saving it.
2018-07-28 17:26:56 +02:00
print '<tr class="oddeven">';
2019-03-26 12:18:28 +01:00
print '<td>'.$langs->trans("EXPORTS_SHARE_MODELS").'</td>';
2019-03-20 09:53:29 +01:00
print '<td class="center" width="20">&nbsp;</td>';
print '<td class="center" width="100">';
2020-09-19 01:45:40 +02:00
print ajax_constantonoff('EXPORTS_SHARE_MODELS');
print '</td></tr>';
*/
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ExportCsvSeparator").'</td>';
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>';
print '<td class="right"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
print '</tr>';
2018-01-18 12:34:22 +01:00
print '</table>';
2020-03-18 19:07:15 +01:00
print '</form>';
2020-10-27 18:19:31 +01:00
print dol_get_fiche_end();
2019-03-26 12:18:28 +01:00
2018-07-28 17:26:56 +02:00
// End of page
2018-01-18 12:34:22 +01:00
llxFooter();
2018-05-26 18:41:16 +02:00
$db->close();