index.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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/exports/index.php
  19. * \ingroup export
  20. * \brief Home page of export wizard
  21. */
  22. require_once '../main.inc.php';
  23. require_once DOL_DOCUMENT_ROOT.'/exports/class/export.class.php';
  24. // Load translation files required by the page
  25. $langs->load("exports");
  26. $export = new Export($db);
  27. $export->load_arrays($user);
  28. // Security check
  29. $result = restrictedArea($user, 'export');
  30. /*
  31. * View
  32. */
  33. $form = new Form($db);
  34. $help_url = 'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones|DE:Modul_DatenExporte';
  35. llxHeader('', $langs->trans("ExportsArea"), $help_url);
  36. print load_fiche_titre($langs->trans("ExportsArea"));
  37. print $langs->trans("FormatedExportDesc1").'<br>';
  38. print '<br>';
  39. print '<div class="center">';
  40. if (count($export->array_export_code)) {
  41. print dolGetButtonTitle($langs->trans('NewExport'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/exports/export.php?leftmenu=export', '', $user->rights->export->creer);
  42. }
  43. print '</div>';
  44. print '<br>';
  45. // List of available export formats
  46. print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
  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/export/modules_export.php';
  54. $model = new ModeleExports($db);
  55. $liste = $model->listOfAvailableExportFormat($db); // This is not a static method for exports because method load non static properties
  56. foreach ($liste as $key => $val) {
  57. if (preg_match('/__\(Disabled\)__/', $liste[$key])) {
  58. $liste[$key] = preg_replace('/__\(Disabled\)__/', '('.$langs->transnoentitiesnoconv("Disabled").')', $liste[$key]);
  59. }
  60. print '<tr class="oddeven">';
  61. print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key), $model->getPictoForKey($key)).'</td>';
  62. $text = $model->getDriverDescForKey($key);
  63. $label = $liste[$key];
  64. print '<td>'.$form->textwithpicto($label, $text).'</td>';
  65. print '<td>'.$model->getLibLabelForKey($key).'</td>';
  66. print '<td class="nowrap right">'.$model->getLibVersionForKey($key).'</td>';
  67. print '</tr>';
  68. }
  69. print '</table>';
  70. print '</div>';
  71. // End of page
  72. llxFooter();
  73. $db->close();