2007-04-27 14:33:27 +02:00
|
|
|
<?php
|
2015-05-13 07:46:12 +02:00
|
|
|
/* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
2024-11-04 23:53:20 +01:00
|
|
|
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
2007-04-27 14:33:27 +02: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
|
2013-01-16 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2007-04-27 14:33:27 +02:00
|
|
|
* (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/>.
|
2007-04-27 14:33:27 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2010-07-21 14:35:56 +02:00
|
|
|
* \file htdocs/imports/index.php
|
2009-11-04 21:58:56 +01:00
|
|
|
* \ingroup import
|
2012-09-09 14:49:20 +02:00
|
|
|
* \brief Home page of import wizard
|
2009-05-19 02:33:57 +02:00
|
|
|
*/
|
|
|
|
|
|
2012-08-22 23:11:24 +02:00
|
|
|
require_once '../main.inc.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/imports/class/import.class.php';
|
2007-04-27 14:33:27 +02:00
|
|
|
|
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 21:11:25 +02:00
|
|
|
// Load translation files required by the page
|
2007-10-22 20:03:54 +02:00
|
|
|
$langs->load("exports");
|
2007-04-27 14:33:27 +02:00
|
|
|
|
2021-02-26 18:20:21 +01:00
|
|
|
if (!$user->socid == 0) {
|
|
|
|
|
accessforbidden();
|
|
|
|
|
}
|
2007-04-27 14:33:27 +02:00
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$import = new Import($db);
|
2009-05-19 02:33:57 +02:00
|
|
|
$import->load_arrays($user);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* View
|
|
|
|
|
*/
|
2007-10-22 20:03:54 +02:00
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$form = new Form($db);
|
2009-09-28 22:06:15 +02:00
|
|
|
|
2019-01-27 11:55:16 +01:00
|
|
|
llxHeader('', $langs->trans("ImportArea"), 'EN:Module_Imports_En|FR:Module_Imports|ES:Módulo_Importaciones');
|
2007-10-22 20:03:54 +02:00
|
|
|
|
2015-09-24 18:33:48 +02:00
|
|
|
print load_fiche_titre($langs->trans("ImportArea"));
|
2007-10-22 20:03:54 +02:00
|
|
|
|
|
|
|
|
print $langs->trans("FormatedImportDesc1").'<br>';
|
|
|
|
|
print '<br>';
|
2007-04-27 14:33:27 +02:00
|
|
|
|
|
|
|
|
|
2014-11-25 20:13:43 +01:00
|
|
|
print '<div class="center">';
|
2021-02-26 18:20:21 +01:00
|
|
|
if (count($import->array_import_code)) {
|
2020-10-31 14:32:18 +01:00
|
|
|
print dolGetButtonTitle($langs->trans('NewImport'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/imports/import.php?leftmenu=import');
|
2012-09-09 16:32:03 +02:00
|
|
|
}
|
2014-11-25 20:13:43 +01:00
|
|
|
print '</div>';
|
2013-06-05 16:24:32 +02:00
|
|
|
print '<br>';
|
2007-04-27 14:33:27 +02:00
|
|
|
|
|
|
|
|
|
2012-09-09 16:32:03 +02:00
|
|
|
// List of available import format
|
2019-11-02 17:34:27 +01:00
|
|
|
print '<div class="div-table-responsive-no-min">';
|
2019-11-05 21:24:41 +01:00
|
|
|
print '<table class="noborder centpercent">';
|
2012-09-09 16:32:03 +02:00
|
|
|
print '<tr class="liste_titre">';
|
|
|
|
|
print '<td colspan="2">'.$langs->trans("AvailableFormats").'</td>';
|
|
|
|
|
print '<td>'.$langs->trans("LibraryShort").'</td>';
|
2019-03-16 09:16:36 +01:00
|
|
|
print '<td class="right">'.$langs->trans("LibraryVersion").'</td>';
|
2012-09-09 16:32:03 +02:00
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
include_once DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php';
|
2020-04-10 10:59:32 +02:00
|
|
|
$model = new ModeleImports();
|
2022-12-31 17:08:10 +01:00
|
|
|
$list = $model->listOfAvailableImportFormat($db);
|
2012-09-09 16:32:03 +02:00
|
|
|
|
2021-02-26 18:20:21 +01:00
|
|
|
foreach ($list as $key) {
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2019-01-27 11:55:16 +01:00
|
|
|
print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key), $model->getPictoForKey($key)).'</td>';
|
2020-04-10 10:59:32 +02:00
|
|
|
$text = $model->getDriverDescForKey($key);
|
2024-03-07 20:16:48 +01:00
|
|
|
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
2019-01-27 11:55:16 +01:00
|
|
|
print '<td>'.$form->textwithpicto($model->getDriverLabelForKey($key), $text).'</td>';
|
2012-11-11 18:11:10 +01:00
|
|
|
print '<td>'.$model->getLibLabelForKey($key).'</td>';
|
2019-03-15 09:41:56 +01:00
|
|
|
print '<td class="nowrap right">'.$model->getLibVersionForKey($key).'</td>';
|
2012-09-09 16:32:03 +02:00
|
|
|
print '</tr>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '</table>';
|
2019-11-02 17:34:27 +01:00
|
|
|
print '</div>';
|
2007-10-22 20:03:54 +02:00
|
|
|
|
2009-07-29 21:47:15 +02:00
|
|
|
|
2018-08-13 11:25:48 +02:00
|
|
|
// End of page
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2013-06-05 16:24:32 +02:00
|
|
|
$db->close();
|