index.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. /* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/imports/index.php
  19. * \ingroup import
  20. * \brief Home page of import wizard
  21. */
  22. require_once '../main.inc.php';
  23. require_once DOL_DOCUMENT_ROOT.'/imports/class/import.class.php';
  24. // Load translation files required by the page
  25. $langs->load("exports");
  26. if (!$user->socid == 0) {
  27. accessforbidden();
  28. }
  29. $import = new Import($db);
  30. $import->load_arrays($user);
  31. /*
  32. * View
  33. */
  34. $form = new Form($db);
  35. llxHeader('', $langs->trans("ImportArea"), 'EN:Module_Imports_En|FR:Module_Imports|ES:M&oacute;dulo_Importaciones');
  36. print load_fiche_titre($langs->trans("ImportArea"));
  37. print $langs->trans("FormatedImportDesc1").'<br>';
  38. print '<br>';
  39. print '<div class="center">';
  40. if (count($import->array_import_code)) {
  41. print dolGetButtonTitle($langs->trans('NewImport'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/imports/import.php?leftmenu=import');
  42. }
  43. print '</div>';
  44. print '<br>';
  45. // List of available import format
  46. print '<div class="div-table-responsive-no-min">';
  47. print '<table class="noborder centpercent">';
  48. print '<tr class="liste_titre">';
  49. print '<td colspan="2">'.$langs->trans("AvailableFormats").'</td>';
  50. print '<td>'.$langs->trans("LibraryShort").'</td>';
  51. print '<td class="right">'.$langs->trans("LibraryVersion").'</td>';
  52. print '</tr>';
  53. include_once DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php';
  54. $model = new ModeleImports();
  55. $list = $model->liste_modeles($db);
  56. foreach ($list as $key) {
  57. print '<tr class="oddeven">';
  58. print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key), $model->getPictoForKey($key)).'</td>';
  59. $text = $model->getDriverDescForKey($key);
  60. print '<td>'.$form->textwithpicto($model->getDriverLabelForKey($key), $text).'</td>';
  61. print '<td>'.$model->getLibLabelForKey($key).'</td>';
  62. print '<td class="nowrap right">'.$model->getLibVersionForKey($key).'</td>';
  63. print '</tr>';
  64. }
  65. print '</table>';
  66. print '</div>';
  67. // End of page
  68. llxFooter();
  69. $db->close();