dolibarr/htdocs/admin/export.php

111 lines
3.5 KiB
PHP
Raw 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>
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
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
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
if (!$user->admin)
2018-01-18 12:34:22 +01:00
accessforbidden();
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'));
}
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));
// 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
dol_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
// Example with a yes / no select
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>';
2020-09-28 18:49:20 +02:00
print '<td width="60" align="center"><input class="flat width50" maxlength="3" type="text" name="EXPORT_CSV_SEPARATOR_TO_USE" value="'.(empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE) ? ',' : $conf->global->EXPORT_CSV_SEPARATOR_TO_USE).'"></td>';
print '<td class="right"><input type="submit" class="button" 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>';
2019-03-26 12:18:28 +01:00
dol_fiche_end();
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();